Less magic in Grunt

This commit is contained in:
Vit Brunner
2015-03-13 19:55:58 +01:00
parent 55ff63c154
commit c1dc77eb5b
+13 -9
View File
@@ -33,9 +33,6 @@ add = (subtasks, defaults = {}) ->
, {})
get_base = (vars, min = false) ->
if typeof(vars.base) == 'string'
return vars.base
return if min then '/sbs/' else '/'
module.exports = (grunt) ->
@@ -176,9 +173,21 @@ module.exports = (grunt) ->
grunt.config 'copy', add([
[ 'main', {
src: [ '.htaccess', 'tests/the_raven/*' ]
options: {
processContent: (content) ->
grunt.template.process content, { data: {
base: get_base(vars)
}}
}
}]
[ 'min', {
src: [ '.htaccess', 'tests/the_raven/*' ]
options: {
processContent: (content) ->
grunt.template.process content, { data: {
base: get_base(vars, true)
}}
}
}]
[ 'min_fonts', {
cwd: 'build/bower_components/fontawesome/fonts'
@@ -194,12 +203,7 @@ module.exports = (grunt) ->
dest + src.replace('-USAGE', '')
options: {}
}]
], {
options: {
processContent: (content) ->
grunt.template.process content, { data: { base: get_base(vars) } }
}
})
])
grunt.config 'jade', add([
[ 'main', { options: {