Skip to content

Commit

Permalink
lib
Browse files Browse the repository at this point in the history
  • Loading branch information
LoicMahieu committed Jun 20, 2016
1 parent c89f1d9 commit 6444811
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 12 additions & 2 deletions lib/NpmUtilities.js
Expand Up @@ -93,8 +93,18 @@ var NpmUtilities = (_dec = _logger2.default.logifyAsync, _dec2 = _logger2.defaul
}
}, {
key: "runScriptInDir",
value: function runScriptInDir(script, args, directory, callback) {
NpmUtilities.execInDir("run " + script, args, directory, callback);
value: function runScriptInDir(script, args, directory, options, callback) {
if (typeof options === 'function') {
callback = options;
}

args = ["run", script].concat(args);
var opts = Object.assign({
cwd: directory,
stdio: "ignore"
}, options);

_ChildProcessUtilities2.default.spawn("npm", args, opts, callback);
}
}, {
key: "publishTaggedInDir",
Expand Down
4 changes: 3 additions & 1 deletion lib/commands/RunCommand.js
Expand Up @@ -107,7 +107,9 @@ var RunCommand = function (_Command) {
value: function runScriptInPackage(pkg, callback) {
var _this5 = this;

_NpmUtilities2.default.runScriptInDir(this.script, this.args, pkg.location, function (err, stdout) {
_NpmUtilities2.default.runScriptInDir(this.script, this.args, pkg.location, {
stdio: this.flags.stdio
}, function (err, stdout) {
if (err) {
_this5.logger.error("Errored while running npm script '" + _this5.script + "' in '" + pkg.name + "'", err);
} else {
Expand Down

0 comments on commit 6444811

Please sign in to comment.