Skip to content

Commit

Permalink
chore: fix collect git status command
Browse files Browse the repository at this point in the history
  • Loading branch information
mimokmt committed Jun 26, 2024
1 parent e366bf0 commit b199c4c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/pullrequest-cli/src/getChangedFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { execp } from './utils'
*/
export async function* getChangedFiles(dir: string) {
if (!existsSync(dir))
throw new Error(`icons-cli: target directory not found (${dir})`)
throw new Error(`pullrequest-cli: target directory not found (${dir})`)
const gitStatus = await collectGitStatus()
for (const [relativePath, status] of gitStatus) {
const fullpath = path.resolve(process.cwd(), relativePath)
if (!fullpath.startsWith(`${dir}/`)) {
continue
}
if (!existsSync(fullpath))
throw new Error(`icons-cli: could not load svg (${fullpath})`)
throw new Error(`pullrequest-cli: could not load svg (${fullpath})`)
const content = await fs.readFile(fullpath, { encoding: 'utf-8' })
yield { relativePath, content, status }
}
Expand All @@ -26,7 +26,7 @@ async function collectGitStatus() {
/**
* @see https://git-scm.com/docs/git-status#_porcelain_format_version_1
*/
(await execp(`git status --porcelain`)).split('\n').map((s) => {
(await execp(`git status --porcelain -u`)).split('\n').map((s) => {
return [
s.slice(3),
s.startsWith(' M')
Expand Down

0 comments on commit b199c4c

Please sign in to comment.