Errored if `grunt master` run in dirty working directory (#10476)

refs #9441 

* Refactored master script
* Added check for working directory
This commit is contained in:
Fabien O'Carroll 2019-02-11 17:25:25 +01:00 committed by GitHub
parent bdd57b36cf
commit 92621159a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 3 deletions

View File

@ -214,9 +214,19 @@ const configureGrunt = function (grunt) {
command: function () {
var upstream = grunt.option('upstream') || process.env.GHOST_UPSTREAM || 'upstream';
grunt.log.writeln('Pulling down the latest master from ' + upstream);
return 'git checkout master; git pull ' + upstream + ' master; ' +
'yarn; git submodule foreach "git checkout master && git pull ' +
upstream + ' master"';
return `
if ! git diff --exit-code --quiet; then
echo "Working directory is not clean, do you have uncommited changes? Please commit, stash or discard changes to continue."
exit 1
fi
git checkout master
git pull ${upstream} master
yarn
git submodule foreach "
git checkout master && git pull ${upstream} master
"
`;
}
}
},