Skip to content

Commit

Permalink
feat(grunt): add theme dev task
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Aug 26, 2015
1 parent 9c3a099 commit d8380d4
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ module.exports = (grunt) ->
theme:
assets: "<%= amsf.user.assets %>/themes/<%= amsf.theme.current %>"
current: "<%= config.amsf.theme %>"
new_name: grunt.option('theme') or "<%= amsf.theme.current %>"
new_author: grunt.option('user') or "amsf"
new_name: grunt.option("theme") or "<%= amsf.theme.current %>"
new_author: grunt.option("user") or "amsf"

coffeelint:
options:
Expand Down Expand Up @@ -88,7 +88,7 @@ module.exports = (grunt) ->

jekyll:
files: ["<%= config.app %>/**/*", "!_*", "_config*.yml"]
tasks: ['jekyll:serve']
tasks: ["jekyll:serve"]

uglify:
dist:
Expand Down Expand Up @@ -286,6 +286,9 @@ module.exports = (grunt) ->
s3:
command: "s3cmd sync -rP --guess-mime-type --delete-removed --no-preserve --cf-invalidate --add-header=Cache-Control:max-age=31536000 --exclude '.DS_Store' <%= config.cfg.static_files %> <%= config.cfg.s3_bucket %>"

amsf__theme__to_dev_repo:
command: "rsync -avz --delete --progress --exclude=.git <%= amsf.base %>/themes/<%= amsf.theme.current %>/ /Users/sparanoid/Git/amsf-<%= amsf.theme.current %> > rsync-theme-dev.log"

concurrent:
options:
logConcurrentOutput: true
Expand Down Expand Up @@ -572,9 +575,9 @@ module.exports = (grunt) ->
options:
files: ["package.json"]
updateConfigs: ["config.pkg"]
commitMessage: 'chore: release v%VERSION%'
commitMessage: "chore: release v%VERSION%"
commitFiles: ["-a"]
tagMessage: 'chore: create tag %VERSION%'
tagMessage: "chore: create tag %VERSION%"
push: false

grunt.registerTask "serve", "Fire up a server on local machine for development", [
Expand All @@ -595,9 +598,16 @@ module.exports = (grunt) ->
"copy:amsf__theme__to_app"
]

grunt.registerTask "theme-save", "Save current (previously activated) theme to AMSF cache", [
"copy:amsf__theme__to_cache"
]
grunt.registerTask "theme-save", "Save current (previously activated) theme to AMSF cache", ->
if grunt.option("dev")
grunt.task.run [
"copy:amsf__theme__to_cache"
"shell:amsf__theme__to_dev_repo"
]
else
grunt.task.run [
"copy:amsf__theme__to_cache"
]

grunt.registerTask "theme-activate", "Activate specific theme", [
"theme-upgrade"
Expand Down

0 comments on commit d8380d4

Please sign in to comment.