Skip to content

Commit 5c9d1e9

Browse files
committed
Use grunt-shell instead of package.json script
Fixes #292
1 parent 72a9ebb commit 5c9d1e9

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

Gruntfile.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var serveStatic = require("serve-static");
22

33
module.exports = function (grunt) {
4+
grunt.loadNpmTasks("dgeni-alive");
45
grunt.loadNpmTasks("grunt-bump");
56
grunt.loadNpmTasks("grunt-contrib-clean");
67
grunt.loadNpmTasks("grunt-contrib-concat");
@@ -12,7 +13,7 @@ module.exports = function (grunt) {
1213
grunt.loadNpmTasks("grunt-karma");
1314
grunt.loadNpmTasks("grunt-ng-annotate");
1415
grunt.loadNpmTasks("grunt-protractor-runner");
15-
grunt.loadNpmTasks("dgeni-alive");
16+
grunt.loadNpmTasks("grunt-shell");
1617

1718
grunt.initConfig({
1819
pkg: grunt.file.readJSON("package.json"),
@@ -148,6 +149,15 @@ module.exports = function (grunt) {
148149
}
149150
},
150151

152+
shell: {
153+
protractor_update: {
154+
command: "./node_modules/.bin/webdriver-manager update",
155+
options: {
156+
stdout: true
157+
}
158+
}
159+
},
160+
151161
"dgeni-alive": {
152162
options: {
153163
serve: {
@@ -170,8 +180,8 @@ module.exports = function (grunt) {
170180

171181
grunt.registerTask("default", ["test"]);
172182
grunt.registerTask("build", ["clean", "jshint", "jscs", "concat", "ngAnnotate", "uglify"]);
173-
grunt.registerTask("test", ["build", "connect:e2e", "karma:unit", "karma:unit_nojquery", "protractor:dev", "watch:all"]);
174-
grunt.registerTask("test_unit", ["build", "karma:unit", "karma:unit_nojquery", "watch:unit"]);
175-
grunt.registerTask("test_e2e", ["build", "connect:e2e", "protractor:dev", "watch:e2e"]);
176-
grunt.registerTask("ci", ["build", "karma:unitci", "karma:unitci_nojquery", "connect:e2e", "protractor:ci"]);
183+
grunt.registerTask("test", ["build", "shell:protractor_update", "connect:e2e", "karma:unit", "karma:unit_nojquery", "protractor:dev", "watch:all"]);
184+
grunt.registerTask("test_unit", ["build", "shell:protractor_update", "karma:unit", "karma:unit_nojquery", "watch:unit"]);
185+
grunt.registerTask("test_e2e", ["build", "shell:protractor_update", "connect:e2e", "protractor:dev", "watch:e2e"]);
186+
grunt.registerTask("ci", ["build", "shell:protractor_update", "karma:unitci", "karma:unitci_nojquery", "connect:e2e", "protractor:ci"]);
177187
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"scripts": {
1111
"test": "grunt ci",
12-
"install": "if [ -x ./node_modules/protractor/bin/webdriver-manager ]; then ./node_modules/protractor/bin/webdriver-manager update; fi",
1312
"prepublish": "grunt build"
1413
},
1514
"keywords": [
@@ -38,6 +37,7 @@
3837
"grunt-karma": "~2.0.0",
3938
"grunt-ng-annotate": "^2.0.2",
4039
"grunt-protractor-runner": "^3.2.0",
40+
"grunt-shell": "^1.3.0",
4141
"karma": "~0.13.22",
4242
"karma-chai": "~0.1.0",
4343
"karma-firefox-launcher": "~1.0.0",

0 commit comments

Comments
 (0)