From f8eb9b5eb396487a5271ad8f5ec15ed40c7b0226 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 9 Apr 2016 14:01:13 -0700 Subject: [PATCH] cd in shell tasks does not change directory. --- Gruntfile.coffee | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 9a53802ea..171527151 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -136,6 +136,11 @@ module.exports = (grunt) -> git commit -am "Release <%= pkg.meta.name %> v<%= pkg.meta.version %>." git tag -a <%= pkg.meta.version %> -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>." """.split('\n').join('&&') + 'gh-pages': + command: """ + git checkout gh-pages + git pull + """.split('\n').join('&&') beta: command: """ git tag -af beta -m "<%= pkg.meta.name %> v<%= pkg.meta.version %>." @@ -179,17 +184,6 @@ module.exports = (grunt) -> """.split('\n').join('&&') push: command: 'git push origin --tags -f && git push origin --all' - prestore: - command: """ - cd .. - cd "<%= pkg.meta.path %>.gh-pages" - git checkout gh-pages - """ - poststore: - command: """ - cd .. - cd "<%= pkg.meta.path %>" - """ aws: command: """ cd .. @@ -417,6 +411,15 @@ module.exports = (grunt) -> parts[i] = 0 for i in [level...parts.length] grunt.task.run "tag:#{parts.join '.'}" + grunt.registerTask 'pushd', 'Change directory to the distribution worktree and check out gh-pages branch.', -> + pkg = grunt.config 'pkg' + grunt.file.setBase "../#{pkg.meta.path}.gh-pages" + grunt.task.run 'shell:gh-pages' + + grunt.registerTask 'popd', 'Return to the normal working directory.', -> + pkg = grunt.config 'pkg' + grunt.file.setBase "../#{pkg.meta.path}" + grunt.registerTask 'beta', [ 'shell:beta' ] @@ -443,9 +446,9 @@ module.exports = (grunt) -> ] grunt.registerTask 'store', [ - 'shell:prestore' + 'pushd' 'webstore_upload' - 'shell:poststore' + 'popd' ] grunt.registerTask 'captchas', 'Set captcha complaints redirect.', (url='https://www.4chan.org/feedback') ->