Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Commit

Permalink
forgot to add glob dev dependency
Browse files Browse the repository at this point in the history
travis builds on node 0.10 which doesn't have promise
  • Loading branch information
zaggino committed Aug 25, 2016
1 parent b26c021 commit f1ba730
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
10 changes: 5 additions & 5 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"lodash": "4.15.0"
},
"devDependencies": {
"glob": "7.0.6",
"grunt": "0.4.5",
"jasmine-node": "1.11.0",
"grunt-jasmine-node": "0.1.0",
Expand Down
1 change: 1 addition & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"lodash": "4.15.0"
},
"devDependencies": {
"glob": "7.0.6",
"grunt": "0.4.5",
"jasmine-node": "1.11.0",
"grunt-jasmine-node": "0.1.0",
Expand Down
33 changes: 15 additions & 18 deletions tasks/npm-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
*/

/*jslint node: true */
/*global Promise */

module.exports = function (grunt) {
"use strict";
Expand All @@ -34,17 +33,15 @@ module.exports = function (grunt) {
path = require("path"),
exec = require('child_process').exec;

function runNpmInstall(where) {
return new Promise(function (resolve, reject) {
grunt.log.writeln("running npm install --production in " + where);
exec('npm install --production', { cwd: './' + where }, function (err, stdout, stderr) {
if (err) {
grunt.log.error(stderr);
} else {
grunt.log.writeln(stdout || "finished npm install in " + where);
}
return err ? reject(stderr) : resolve(stdout);
});
function runNpmInstall(where, callback) {
grunt.log.writeln("running npm install --production in " + where);
exec('npm install --production', { cwd: './' + where }, function (err, stdout, stderr) {
if (err) {
grunt.log.error(stderr);
} else {
grunt.log.writeln(stdout || "finished npm install in " + where);
}
return err ? callback(stderr) : callback(null, stdout);
});
}

Expand All @@ -56,9 +53,9 @@ module.exports = function (grunt) {
common.writeJSON(grunt, "dist/package.json", packageJSON);

var done = this.async();
runNpmInstall("dist")
.then(function () { done(); })
.catch(function (err) { done(false); });
runNpmInstall("dist", function (err) {
return err ? done(false) : done();
});
});

grunt.registerTask("npm-install-extensions", "Install node_modules for default extensions which have package.json defined", function () {
Expand All @@ -73,9 +70,9 @@ module.exports = function (grunt) {
});
var done = _.after(files.length, _done);
files.forEach(function (file) {
runNpmInstall(path.dirname(file))
.then(function () { done(); })
.catch(function (err) { _done(false); });
runNpmInstall(path.dirname(file), function (err) {
return err ? _done(false) : done();
});
});
});
});
Expand Down

0 comments on commit f1ba730

Please sign in to comment.