From 90f529603ee3d81b90913f98175cb06fd6ef4032 Mon Sep 17 00:00:00 2001 From: Rachel Fenichel Date: Wed, 16 Oct 2019 11:17:59 -0600 Subject: [PATCH] Review feedback --- gulpfile.js | 48 +++++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 752430613..32fe0cfef 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -772,7 +772,7 @@ gulp.task('release', gulp.series(['build', 'typings', function() { gulp.task('default', gulp.series(['build'])); // Stash current state, check out develop, and sync with google/blockly. -gulp.task('syncDevelop', function(done) { +gulp.task('git-sync-develop', function(done) { execSync('git stash save -m "Stash for sync"', { stdio: 'inherit' }); execSync('git checkout develop', { stdio: 'inherit' }); execSync('git pull https://github.com/google/blockly.git develop', @@ -788,33 +788,27 @@ function getRebuildBranchName() { var dd = date.getDate(); // Day of the month, 1-31 var yyyy = date.getFullYear(); return 'rebuild_' + mm + '_' + dd + '_' + yyyy; -} - -// Stash and make a new branch for a rebuild. -gulp.task('make-rebuild-branch', function(done) { - execSync('git stash save -m "Stash for rebuild"', { stdio: 'inherit' }); - var branchName = getRebuildBranchName(); - console.log('make-rebuild-branch: creating branch ' + branchName); - execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); - done(); -}); - -// Commit and push the current rebuild branch. -gulp.task('push-rebuild-branch', function(done) { - console.log('push-rebuild-branch: committing rebuild'); - execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); - var branchName = getRebuildBranchName(); - execSync('git push origin ' + branchName, { stdio: 'inherit' }); - console.log('Branch ' + branchName + ' pushed to GitHub.'); - console.log('Next step: create a pull request against develop.'); - done(); -}); +}; // Recompile and push to origin. -gulp.task('recompile', gulp.series[ - 'syncDevelop', - 'make-rebuild-branch' +gulp.task('recompile', gulp.series([ + 'git-sync-develop', + function(done) { + execSync('git stash save -m "Stash for rebuild"', { stdio: 'inherit' }); + var branchName = getRebuildBranchName(); + console.log('make-rebuild-branch: creating branch ' + branchName); + execSync('git checkout -b ' + branchName, { stdio: 'inherit' }); + done(); + }, 'build', - 'push-rebuild-branch' - ] + function(done) { + console.log('push-rebuild-branch: committing rebuild'); + execSync('git commit -am "Rebuild"', { stdio: 'inherit' }); + var branchName = getRebuildBranchName(); + execSync('git push origin ' + branchName, { stdio: 'inherit' }); + console.log('Branch ' + branchName + ' pushed to GitHub.'); + console.log('Next step: create a pull request against develop.'); + done(); + } + ]) );