From df43996fb3ebe6644f8b0d1147a8f381c29807e0 Mon Sep 17 00:00:00 2001 From: Joe Turgeon Date: Fri, 26 Sep 2014 15:43:13 -0500 Subject: [PATCH] Allowing extra arguments to be specified in Gruntconfig.json for the drush:make task. --- example/Gruntconfig.json | 5 +++++ tasks/drush.js | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/example/Gruntconfig.json b/example/Gruntconfig.json index e9fb0fd1..c67ff58e 100644 --- a/example/Gruntconfig.json +++ b/example/Gruntconfig.json @@ -23,5 +23,10 @@ "phpmd": { "path": "bin/phpmd" }, + "drush": { + "make": { + "args": [] + } + }, "compassConfig": {} } diff --git a/tasks/drush.js b/tasks/drush.js index 118ea495..32fea9a3 100644 --- a/tasks/drush.js +++ b/tasks/drush.js @@ -9,9 +9,18 @@ module.exports = function(grunt) { grunt.loadTasks(__dirname + '/../node_modules/grunt-drush/tasks'); grunt.loadTasks(__dirname + '/../node_modules/grunt-newer/tasks'); + // Allow extra arguments for drush to be supplied. + var args = ['make', '<%= config.srcPaths.make %>'], + extra_args = grunt.config.get('config.drush.make.args'); + if (extra_args && extra_args.length) { + extra_args.unshift(args[0]); + extra_args.push(args[1]); + args = extra_args; + } + grunt.config('drush', { make: { - args: ['make', '<%= config.srcPaths.make %>'], + args: args, dest: '<%= config.buildPaths.html %>' } });