From be9485d45ef8a5951d4f0395d527dcef86a42e3b Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Thu, 26 Apr 2018 10:15:50 +0200 Subject: [PATCH] Wrapped paths in quotation marks because they can contain a space that will break the command. --- lib/commands/bootstrap.js | 4 ++-- tests/commands/bootstrap.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/commands/bootstrap.js b/lib/commands/bootstrap.js index a867345..32351e4 100644 --- a/lib/commands/bootstrap.js +++ b/lib/commands/bootstrap.js @@ -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( ' && ' ); diff --git a/tests/commands/bootstrap.js b/tests/commands/bootstrap.js index 729663c..54a685c 100644 --- a/tests/commands/bootstrap.js +++ b/tests/commands/bootstrap.js @@ -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' );