Skip to content

Commit

Permalink
feat(grunt): add custom theme URL support
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Now you need to set `amsf_theme_url` in `_amsf.yml` before upgrading to the latest version of Almace Scaffolding:

```yaml
amsf_theme_url: https://github.com/amsf/amsf-curtana (or your own if you've already using a custom theme from me)
```

Then you can simply run `grunt update` to process the update. This could be more complex for end users but it also allows users to use custom theme hosted wherever they want.
  • Loading branch information
sparanoid committed Nov 7, 2016
1 parent 4a2c6a1 commit 5d2efc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ module.exports = (grunt) ->
branch: "master"
assets: "<%= amsf.user.assets %>/themes/<%= amsf.theme.current %>"
current: "<%= config.amsf.amsf_theme %>"
current_url: "<%= config.amsf.amsf_theme_url %>"
new_name: grunt.option("theme") or "<%= amsf.theme.current %>"
new_author: grunt.option("user") or "amsf"
new_url: grunt.option("url") or "<%= amsf.theme.current_url %>"

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

amsf__theme__add_remote:
options:
repository: "https://github.com/<%= amsf.theme.new_author %>/amsf-<%= amsf.theme.new_name %>.git"
repository: "<%= amsf.theme.new_url %>.git"
branch: "<%= amsf.theme.branch %>"
directory: "<%= amsf.base %>/themes/<%= amsf.theme.new_name %>/"

Expand Down Expand Up @@ -504,6 +505,10 @@ module.exports = (grunt) ->
from: /(amsf_theme: +)(.+)/g
to: "$1<%= amsf.theme.new_name %>"
}
{
from: /(amsf_theme_url: +)(.+)/g
to: "$1<%= amsf.theme.new_url %>"
}
]

amsf__core__update_version:
Expand Down
1 change: 1 addition & 0 deletions _amsf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ version: 1.0.1

# Current theme
amsf_theme: curtana
amsf_theme_url: https://github.com/amsf/amsf-curtana

0 comments on commit 5d2efc6

Please sign in to comment.