Skip to content

Commit

Permalink
added support for command line arguments to the child process
Browse files Browse the repository at this point in the history
  • Loading branch information
G3z committed Dec 29, 2012
1 parent 064a4c8 commit b6b2f1a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/toaster/core/builder.coffee
Expand Up @@ -120,15 +120,24 @@ class Builder


# autorun mode # autorun mode
if @cli.argv.a 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? if @child?
log "Application restarted:".blue log "Application restarted:".blue
@child.kill('SIGHUP') @child.kill('SIGHUP')
else else
log "Application started:".blue log "Application started:".blue

# adding debug arguments
if @cli.argv.d if @cli.argv.d
@child = cp.fork @release, { execArgv: ['--debug-brk'] } @child = cp.fork @release, args, { execArgv: ['--debug-brk'] }
else else
@child = cp.fork @release @child = cp.fork @release, args


# Creates a NS holder for all folders # Creates a NS holder for all folders
build_namespaces:()-> build_namespaces:()->
Expand Down

0 comments on commit b6b2f1a

Please sign in to comment.