Skip to content

Commit 6d4ef90

Browse files
authored
fix: command args with quotes now parsed correctly (#17)
1 parent 0f049b6 commit 6d4ef90

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

package-lock.json

Lines changed: 10 additions & 9 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
"read-pkg-up": "^4.0.0",
5959
"recursive-copy": "^2.0.9",
6060
"rimraf": "^2.6.2",
61+
"shell-quote": "^1.6.1",
6162
"yargs-parser": "^11.0.0"
6263
},
6364
"devDependencies": {
@@ -73,6 +74,7 @@
7374
"@types/ejs": "^2.6.1",
7475
"@types/inquirer": "0.0.43",
7576
"@types/jest": "^23.3.13",
77+
"@types/shell-quote": "^1.6.0",
7678
"babel-jest": "^23.6.0",
7779
"browserslist": "^4.4.1",
7880
"doctoc": "^1.3.1",

src/utils/spawn.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { SpawnSyncOptions, SpawnSyncReturns } from "child_process"
22

33
import crossSpawn from "cross-spawn"
4+
import shellQuote from "shell-quote"
45

56
import { debug } from "./debug"
67

@@ -18,7 +19,7 @@ const shouldExit = (
1819
const getCommandParts = (
1920
commandIn: string,
2021
): { command: string; args: string[] } => {
21-
const [command, ...args] = commandIn.split(" ")
22+
const [command, ...args] = shellQuote.parse(commandIn)
2223
return { command, args }
2324
}
2425

0 commit comments

Comments
 (0)