Skip to content

Commit 0f86249

Browse files
author
Joe Turgeon
committed
Changing the fallback Drush path to use the system path to avoid a compatibility break. Ensuring the example and test Gruntconfig.json use the local installed copy of Drush.
1 parent 98479df commit 0f86249

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

CONFIG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ This is an example of the settings for Drush tasks:
231231
```
232232

233233
**drush.cmd**: The path to the Drush executable that should be used for all
234-
Drush operations.
234+
Drush operations. If none is specified, the Drush executable found in the
235+
default PATH will be used.
235236

236237
**drush.make.args**: An array of arguments to pass to Drush for the make
237238
operation.

tasks/drush.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ module.exports = function(grunt) {
99
grunt.loadNpmTasks('grunt-drush');
1010
grunt.loadNpmTasks('grunt-newer');
1111

12-
// Provide a default path for drush.
13-
var cmd = grunt.config('config.drush.cmd') || process.cwd() + '/bin/drush';
12+
var _ = require('lodash');
13+
14+
// If no path is configured for Drush, fallback to the system path.
15+
var cmd = grunt.config('config.drush.cmd') !== undefined ? {cmd: grunt.config('config.drush.cmd')} : {};
1416

1517
// Allow extra arguments for drush to be supplied.
1618
var args = ['make', '<%= config.srcPaths.make %>', '<%= config.buildPaths.temp %>'],
@@ -25,23 +27,19 @@ module.exports = function(grunt) {
2527
grunt.config('drush', {
2628
make: {
2729
args: args,
28-
options: {
29-
cmd: cmd
30-
}
30+
options: _.extend({}, cmd)
3131
},
3232
liteinstall: {
3333
args: ['site-install', '-y', 'standard', '--db-url=sqlite://drupal:[email protected]'],
34-
options: {
35-
cmd: cmd,
34+
options: _.extend({
3635
cwd: '<%= config.buildPaths.html %>'
37-
}
36+
}, cmd)
3837
},
3938
runserver: {
4039
args: ['runserver', '8080'],
41-
options: {
42-
cmd: cmd,
40+
options: _.extend({
4341
cwd: '<%= config.buildPaths.html %>'
44-
}
42+
}, cmd)
4543
}
4644
});
4745

test/test_assets/Gruntconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"path": "bin/phpmd"
2525
},
2626
"drush": {
27+
"cmd": "bin/drush",
2728
"make": {
2829
"args": ["--concurrency=16"]
2930
}

0 commit comments

Comments
 (0)