From 820b462709f2a76881d289a18dad9345effd0215 Mon Sep 17 00:00:00 2001 From: Jonathan Chan Date: Tue, 6 Nov 2018 08:53:59 -0600 Subject: [PATCH] fix: Split git commands to multiple calls to `runCommand` (#67) --- lib/commands/commit.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/commands/commit.js b/lib/commands/commit.js index aa3793d..c8b1cbc 100644 --- a/lib/commands/commit.js +++ b/lib/commands/commit.js @@ -49,17 +49,21 @@ module.exports = { if (options.destination === '.') { return runCommand('cp -R dist/* .', execOptions); } else { - return runCommand('rm -r ' + options.destination + - ' && mkdir ' + options.destination + - ' && cp -R dist/* ' + options.destination + '/', - execOptions); + return runCommand('rm -r ' + options.destination, execOptions) + .then(function() { + return runCommand('mkdir ' + options.destination, execOptions); + }) + .then(function() { + return runCommand('cp -R dist/* ' + options.destination + '/', execOptions); + }); } } function addAndCommit() { - return runCommand('git -c core.safecrlf=false add "' + options.destination + '"' + - ' && git commit -m "' + options.message + '"', - execOptions); + return runCommand('git -c core.safecrlf=false add "' + options.destination + '"', execOptions) + .then(function() { + return runCommand('git commit -m "' + options.message + '"', execOptions); + }) } function returnToPreviousCheckout() {