Skip to content

Commit

Permalink
use double quotes around command arguments
Browse files Browse the repository at this point in the history
The single quotes are not working on windows
  • Loading branch information
tevanoff committed May 14, 2024
1 parent 9f3bdc4 commit afc2e28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion node-src/git/git.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('findFilesFromRepositoryRoot', () => {
const results = await findFilesFromRepositoryRoot('package.json', '**/package.json');

expect(command).toBeCalledTimes(2);
expect(command).toHaveBeenNthCalledWith(2, "git ls-files --full-name -z '/root/package.json' '/root/**/package.json'", expect.any(Object));
expect(command).toHaveBeenNthCalledWith(2, 'git ls-files --full-name -z "/root/package.json" "/root/**/package.json"', expect.any(Object));
expect(results).toEqual(filesFound);
});
});
2 changes: 1 addition & 1 deletion node-src/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export async function findFilesFromRepositoryRoot(...patterns: string[]) {

// Uses `--full-name` to ensure that all files found are relative to the repository root,
// not the directory in which this is executed from
const gitCommand = `git ls-files --full-name -z ${patternsFromRoot.map((p) => `'${p}'`).join(' ')}`;
const gitCommand = `git ls-files --full-name -z ${patternsFromRoot.map((p) => `"${p}"`).join(' ')}`;
const files = await execGitCommand(gitCommand);
return files.split(NULL_BYTE).filter(Boolean);
}
Expand Down

0 comments on commit afc2e28

Please sign in to comment.