Skip to content

Commit 5e43864

Browse files
Marcelo Sauerbrunn Portugalmportuga
Marcelo Sauerbrunn Portugal
authored andcommitted
fix(shell.js): Adding windows support.
Updating paths to support running tasks from windows.
1 parent 2f5ac87 commit 5e43864

File tree

1 file changed

+36
-26
lines changed

1 file changed

+36
-26
lines changed

grunt/shell.js

+36-26
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
1-
module.exports = {
2-
// selenium no longer used
3-
selenium: {
4-
command: './selenium/start',
5-
options: {
6-
async: true
7-
}
8-
},
9-
'protractor-install': {
10-
command: 'node ./node_modules/protractor/bin/webdriver-manager update'
11-
},
12-
'protractor-start': {
13-
command: 'node ./node_modules/protractor/bin/webdriver-manager start',
14-
options: {
15-
// apparently webdriver/selenium writes lots of trash on stderr, and the real output on stdout. No idea why....
16-
stderr: false,
17-
async: true,
18-
execOptions: {
19-
maxBuffer: 400*1024 // or whatever other large value you want
1+
module.exports = function() {
2+
var webdriverManagerPath = './node_modules/protractor/bin/webdriver-manager';
3+
var bowerPath = './node_modules/bower/bin/bower';
4+
5+
if(process.platform === 'win32') {
6+
webdriverManagerPath = '.\\node_modules\\protractor\\bin\\webdriver-manager';
7+
bowerPath = '.\\node_modules\\bower\\bin\\bower';
8+
}
9+
10+
return {
11+
// selenium no longer used
12+
selenium: {
13+
command: './selenium/start',
14+
options: {
15+
async: true
2016
}
17+
},
18+
'protractor-install': {
19+
command: 'node ' + webdriverManagerPath + ' update'
20+
},
21+
'protractor-start': {
22+
command: 'node ' + webdriverManagerPath + ' start',
23+
options: {
24+
// apparently webdriver/selenium writes lots of trash on stderr, and the real output on stdout. No idea why....
25+
stderr: false,
26+
async: true,
27+
execOptions: {
28+
maxBuffer: 400*1024 // or whatever other large value you want
29+
}
30+
}
31+
},
32+
'bower-install': {
33+
command: 'node ' + bowerPath + ' install'
34+
},
35+
'hooks-install': {
36+
command: 'npm run init'
2137
}
22-
},
23-
'bower-install': {
24-
command: 'node ./node_modules/bower/bin/bower install'
25-
},
26-
'hooks-install': {
27-
command: 'npm run init'
28-
}
38+
};
2939
};

0 commit comments

Comments
 (0)