Skip to content

Commit 4af6b03

Browse files
author
Josh Goldberg
authored
Wrapped config lookup paths in quotes (#82)
1 parent 14c42a7 commit 4af6b03

5 files changed

+9
-9
lines changed

src/input/findConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const findConfiguration = async <Configuration>(
1313
command: string,
1414
config: string,
1515
): Promise<DeepPartial<Configuration> | Error> => {
16-
const fullCommand = `${command} ${config}`;
16+
const fullCommand = `${command} "${config}"`;
1717
const stdout = await execAndCatch(exec, fullCommand);
1818

1919
if (stdout instanceof Error) {

src/input/findESLintConfiguration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe("findESLintConfiguration", () => {
3333
await findESLintConfiguration(dependencies, createStubRawSettings());
3434

3535
// Assert
36-
expect(dependencies.exec).toHaveBeenLastCalledWith("eslint --print-config ./eslintrc.js");
36+
expect(dependencies.exec).toHaveBeenLastCalledWith(`eslint --print-config "./eslintrc.js"`);
3737
});
3838

3939
it("includes a configuration file in the ESLint command when one is provided", async () => {
@@ -48,7 +48,7 @@ describe("findESLintConfiguration", () => {
4848

4949
// Assert
5050
expect(dependencies.exec).toHaveBeenLastCalledWith(
51-
"eslint --print-config ./custom/eslintrc.js",
51+
`eslint --print-config "./custom/eslintrc.js"`,
5252
);
5353
});
5454

src/input/findPackagesConfiguration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe("findPackagesConfiguration", () => {
1010
await findPackagesConfiguration(dependencies, undefined);
1111

1212
// Assert
13-
expect(dependencies.exec).toHaveBeenLastCalledWith("cat ./package.json");
13+
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./package.json"`);
1414
});
1515

1616
it("includes a configuration file in the packages command when one is provided", async () => {
@@ -22,7 +22,7 @@ describe("findPackagesConfiguration", () => {
2222
await findPackagesConfiguration(dependencies, config);
2323

2424
// Assert
25-
expect(dependencies.exec).toHaveBeenLastCalledWith("cat ./custom/package.json");
25+
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./custom/package.json"`);
2626
});
2727

2828
it("applies packages defaults when none are provided", async () => {

src/input/findTslintConfiguration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("findTSLintConfiguration", () => {
2626
await findTSLintConfiguration(dependencies, undefined);
2727

2828
// Assert
29-
expect(dependencies.exec).toHaveBeenLastCalledWith("tslint --print-config ./tslint.json");
29+
expect(dependencies.exec).toHaveBeenLastCalledWith(`tslint --print-config "./tslint.json"`);
3030
});
3131

3232
it("includes a configuration file in the TSLint command when one is provided", async () => {
@@ -39,7 +39,7 @@ describe("findTSLintConfiguration", () => {
3939

4040
// Assert
4141
expect(dependencies.exec).toHaveBeenLastCalledWith(
42-
"tslint --print-config ./custom/tslint.json",
42+
`tslint --print-config "./custom/tslint.json"`,
4343
);
4444
});
4545

src/input/findTypeScriptConfiguration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("findTypeScriptConfiguration", () => {
2626
await findTypeScriptConfiguration(dependencies, undefined);
2727

2828
// Assert
29-
expect(dependencies.exec).toHaveBeenLastCalledWith("cat ./tsconfig.json");
29+
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./tsconfig.json"`);
3030
});
3131

3232
it("includes a configuration file in the TypeScript command when one is provided", async () => {
@@ -38,7 +38,7 @@ describe("findTypeScriptConfiguration", () => {
3838
await findTypeScriptConfiguration(dependencies, config);
3939

4040
// Assert
41-
expect(dependencies.exec).toHaveBeenLastCalledWith("cat ./custom/tsconfig.json");
41+
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./custom/tsconfig.json"`);
4242
});
4343

4444
it("applies TypeScript defaults when none are provided", async () => {

0 commit comments

Comments
 (0)