Skip to content

Commit 22b2a3b

Browse files
committed
🐛 fix win bug
1 parent 983e473 commit 22b2a3b

File tree

6 files changed

+28
-21
lines changed

6 files changed

+28
-21
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
"eslint": "^8.23.1",
2222
"eslint-config-prettier": "^8.5.0",
2323
"eslint-plugin-prettier": "^4.2.1",
24+
"graphql-editor-cli": "*",
2425
"impuddle": "0.0.2",
2526
"prettier": "^2.7.1",
2627
"ttypescript": "^1.5.13",
2728
"typescript": "^4.8.3",
28-
"typescript-transform-paths": "^3.3.1",
29-
"graphql-editor-cli": "*"
29+
"typescript-transform-paths": "^3.3.1"
3030
},
31-
"dependencies": {},
3231
"workspaces": [
3332
"packages/cli",
3433
"packages/sandbox"

packages/cli/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-editor-cli",
3-
"version": "0.8.1",
3+
"version": "0.8.2",
44
"description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.",
55
"main": "lib/api.js",
66
"author": "Artur Czemiel",
@@ -67,7 +67,7 @@
6767
"pusher-js": "^7.4.0",
6868
"qs": "^6.11.0",
6969
"run-async": "^2.4.1",
70-
"stucco-js": "^0.10.17",
70+
"stucco-js": "^0.10.18",
7171
"ts-node": "^10.9.1",
7272
"yargs": "^17.5.1"
7373
}

packages/cli/src/common/stucco/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ export const addStucco = ({
3434
fs.writeFileSync(stuccoPath, JSON.stringify(stuccoFileContent, null, 4));
3535
};
3636

37+
const toFile = (s: string) => {
38+
const p = platform();
39+
if (p === 'win32') {
40+
return `"${s}"`;
41+
}
42+
return s;
43+
};
44+
3745
export const stuccoRun = async (props?: {
3846
schemaPath?: string;
3947
configPath?: string;
@@ -44,11 +52,11 @@ export const stuccoRun = async (props?: {
4452
const stuccoPath = path.join(nodeModules, '.bin');
4553
const bin = path.join(
4654
stuccoPath,
47-
platform() === 'win32' ? 'stucco.exe' : 'stucco',
55+
platform() === 'win32' ? 'stucco.cmd' : 'stucco',
4856
);
4957
const args: string[] = ['local', 'start'];
50-
if (props?.schemaPath) args.push('-s', props.schemaPath);
51-
if (props?.configPath) args.push('-c', props.configPath);
58+
if (props?.schemaPath) args.push('-s', toFile(props.schemaPath));
59+
if (props?.configPath) args.push('-c', toFile(props.configPath));
5260

5361
let stuccoChildProcess: ChildProcess | undefined;
5462
let taskRunning = false;

packages/sandbox/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sandbox",
33
"private": true,
4-
"version": "0.8.1",
4+
"version": "0.8.2",
55
"description": "GraphQL -> anything. Use GraphQL as your source of truth. GraphQL Editor Official CLI.",
66
"author": "Artur Czemiel",
77
"license": "MIT",

0 commit comments

Comments
 (0)