Skip to content

Commit

Permalink
Wrapped paths in quotation marks because they can contain a space tha…
Browse files Browse the repository at this point in the history
…t will break the command.
  • Loading branch information
Kamil Piechaczek committed Apr 26, 2018
1 parent 7c2a2ee commit be9485d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/commands/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ module.exports = {
promise = Promise.resolve();
} else {
const command = [
`git clone --progress ${ data.repository.url } ${ destinationPath }`,
`cd ${ destinationPath }`,
`git clone --progress "${ data.repository.url }" "${ destinationPath }"`,
`cd "${ destinationPath }"`,
`git checkout --quiet ${ data.repository.branch }`
].join( ' && ' );

Expand Down
4 changes: 2 additions & 2 deletions tests/commands/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ describe( 'commands/bootstrap', () => {

// Clone the repository.
expect( cloneCommand[ 0 ] )
.to.equal( 'git clone --progress git@github.com/organization/test-package.git packages/test-package' );
.to.equal( 'git clone --progress "git@github.com/organization/test-package.git" "packages/test-package"' );
// Change the directory to cloned package.
expect( cloneCommand[ 1 ] ).to.equal( 'cd packages/test-package' );
expect( cloneCommand[ 1 ] ).to.equal( 'cd "packages/test-package"' );
// And check out to proper branch.
expect( cloneCommand[ 2 ] ).to.equal( 'git checkout --quiet master' );

Expand Down

0 comments on commit be9485d

Please sign in to comment.