Skip to content

Commit dec6237

Browse files
committed
Merge pull request #258 from phase2/task/refine-drupal-targeting
Use --root to set docroot path in lieu of working directory.
2 parents 325bad8 + 987747c commit dec6237

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

tasks/install.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,33 @@ module.exports = function(grunt) {
1414
grunt.loadNpmTasks('grunt-drush');
1515

1616
var Help = require('../lib/help')(grunt),
17-
Drupal = require('../lib/drupal')(grunt);
18-
19-
var path = require('path'),
17+
Drupal = require('../lib/drupal')(grunt),
18+
path = require('path'),
2019
_ = require('lodash');
2120

2221
// If no path is configured for Drush, fallback to the system path.
23-
var cmd = {cmd: Drupal.drushPath()};
24-
25-
var profile = grunt.config('config.project.profile') || 'standard';
22+
var cmd = {cmd: Drupal.drushPath()},
23+
args = [ '--root=<%= config.buildPaths.html %>' ],
24+
profile = grunt.config('config.project.profile') || 'standard',
25+
dbUrl = grunt.option('db-url') || '';
2626

27-
var dbUrl = grunt.option('db-url') || false;
2827
if (dbUrl) {
2928
dbUrl = '--db-url=' + dbUrl;
3029
}
3130

3231
grunt.config(['drush', 'install'], {
33-
args: ['site-install', '-yv', profile, dbUrl],
32+
args: args.concat(['site-install', '-yv', profile, dbUrl]),
3433
options: _.extend({
35-
cwd: '<%= config.buildPaths.html %>'
3634
}, cmd)
3735
});
3836
grunt.config(['drush', 'sql-drop'], {
39-
args:['sql-drop', '-y'],
37+
args: args.concat(['sql-drop', '-y']),
4038
options: _.extend({
41-
cwd: '<%= config.buildPaths.html %>'
4239
}, cmd)
4340
});
4441
grunt.config(['drush', 'updb'], {
45-
args: ['updatedb', '-y' ],
42+
args: args.concat(['updatedb', '-y' ]),
4643
options: _.extend({
47-
cwd: '<%= config.buildPaths.html %>'
4844
}, cmd)
4945
});
5046
grunt.config(['shell', 'loaddb'], {

0 commit comments

Comments
 (0)