Skip to content

Commit

Permalink
Fix crashes when path to prototype contains spaces
Browse files Browse the repository at this point in the history
We had a user unable to use the migration script because the path to
their prototype included spaces. Fix this by not `spawn`ing via the
shell in `bin/cli`; we don't need to, and this way we don't need to
worry about escaping command line arguments.
  • Loading branch information
lfdebrux committed Dec 6, 2022
1 parent 5ad99d4 commit 462670f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixes

- [Fix crashes when path to prototype contains spaces](https://github.com/alphagov/govuk-prototype-kit/pull/1841)

## 13.0.1

### Fixes
Expand Down
2 changes: 0 additions & 2 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ function warnIfNpmStart (argv, env) {

await spawn('npx', ['govuk-prototype-kit', 'init', '--', installDirectory], {
cwd: installDirectory,
shell: true,
stdio: 'inherit'
})
} else if (argv.command === 'init') {
Expand Down Expand Up @@ -212,7 +211,6 @@ function warnIfNpmStart (argv, env) {
await prepareMigration(kitDependency, projectDirectory)

await spawn('npx', ['govuk-prototype-kit', 'migrate', '--', projectDirectory], {
shell: true,
stdio: 'inherit'
})
} else {
Expand Down
1 change: 0 additions & 1 deletion bin/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ async function npmInstall (cwd, dependencies) {
...dependencies
], {
cwd: cwd,
shell: true,
stdio: 'inherit'
})
}
Expand Down

0 comments on commit 462670f

Please sign in to comment.