Permalink
Browse files

added support for command line arguments to the child process

  • Loading branch information...
1 parent 064a4c8 commit b6b2f1a632f5ae125fa235dd3b85b3abcd668f9a @G3z G3z committed Dec 29, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 src/toaster/core/builder.coffee
@@ -120,15 +120,24 @@ class Builder
# autorun mode
if @cli.argv.a
+
+ # getting arguments after the third ( first three are ['node', 'path_to_toaster', '-a'] )
+ args = []
+ if process.argv.length > 3
+ for i in [3...process.argv.length] by 1
+ args.push process.argv[i]
+
if @child?
log "Application restarted:".blue
@child.kill('SIGHUP')
else
log "Application started:".blue
+
+ # adding debug arguments
if @cli.argv.d
- @child = cp.fork @release, { execArgv: ['--debug-brk'] }
+ @child = cp.fork @release, args, { execArgv: ['--debug-brk'] }
else
- @child = cp.fork @release
+ @child = cp.fork @release, args
# Creates a NS holder for all folders
build_namespaces:()->

0 comments on commit b6b2f1a

Please sign in to comment.