Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding some checks to pre/post execs

  • Loading branch information...
commit e94aea237e2afa3bd436230644678ccd6b025d95 1 parent c4687a2
@davglass authored
Showing with 17 additions and 1 deletion.
  1. +17 −1 lib/module.js
View
18 lib/module.js
@@ -52,6 +52,7 @@ var Stack = require('./stack').Stack,
strictMode = false,
defaultLint = lint.defaults,
_exec = require('child_process').exec,
+ _execFile = require('child_process').execFile,
rimraf = require('rimraf'),
ncp = require('ncp').ncp,
jslintConfig = {},
@@ -593,7 +594,22 @@ var exec = function (exec, name, callback) {
exec.forEach(function (cmd) {
log.info('executing ' + cmd);
- var child = _exec(cmd, {
+ var e = _exec, p;
+ if (path.extname(cmd) === '.js') {
+ e = _execFile;
+ } else {
+ if (cmd.indexOf('shifter') === 0) {
+ //Fixing the call to shifter..
+ p = cmd.split(' ');
+ p[0] = which('shifter');
+ cmd = p.join(' ');
+ } else {
+ log.info(cmd);
+ log.warn('THIS MAY NOT BE CROSS PLATFORM!');
+ }
+ }
+
+ var child = e(cmd, {
cwd: process.cwd()
}, stack.add(function (error, stdout, stderr) {
if (stderr) {
Please sign in to comment.
Something went wrong with that request. Please try again.