From 5d2efc682f90beb83f88ab5ffb66241d0d83cbff Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Mon, 7 Nov 2016 21:04:25 +0800 Subject: [PATCH] feat(grunt): add custom theme URL support 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. --- Gruntfile.coffee | 9 +++++++-- _amsf.yml | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 49586fe19..cf506f6c5 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -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: @@ -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 %>/" @@ -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: diff --git a/_amsf.yml b/_amsf.yml index 3495a2020..aea3e06f1 100644 --- a/_amsf.yml +++ b/_amsf.yml @@ -7,3 +7,4 @@ version: 1.0.1 # Current theme amsf_theme: curtana +amsf_theme_url: https://github.com/amsf/amsf-curtana