Skip to content

Commit

Permalink
Set 'cwd' for npm commands. Fixes #547 (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb authored Jul 25, 2016
1 parent d88b758 commit bf3fe1f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/start-local.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
var spawn = require('child_process').spawn,
stdout = '',
execJob,
path = require('path'),
env = {cwd: path.join(__dirname, '..')},
workerJob = null;

process.env.NODE_ENV = 'local';
execJob = spawn('npm', [
'start'
]);
], env);
execJob.stdout.pipe(process.stdout);
execJob.stderr.pipe(process.stderr);

execJob.stdout.on('data', function(chunk) {
if (!workerJob) {
stdout += chunk;
if (stdout.indexOf('DeepForge') > -1) {
workerJob = spawn('npm', ['run', 'worker']);
workerJob = spawn('npm', ['run', 'worker'], env);
workerJob.stdout.pipe(process.stdout);
workerJob.stderr.pipe(process.stderr);
workerJob.on('close', code => code && process.exit(code));
Expand Down

0 comments on commit bf3fe1f

Please sign in to comment.