Skip to content

Commit

Permalink
fix: Split git commands to multiple calls to runCommand (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanJang authored and knownasilya committed Nov 6, 2018
1 parent 8f059e4 commit 820b462
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/commands/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 820b462

Please sign in to comment.