Skip to content

Commit 7ce2df5

Browse files
committed
Add the ability to send args to simulator scripts
1 parent 7b3244c commit 7ce2df5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bin.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ const argv = minimist(process.argv.slice(2), {
2626
host: 'h',
2727
storage: 's',
2828
bootstrap: 'b'
29-
}
29+
},
30+
'--': true
3031
})
32+
console.log('argv:', argv)
3133

3234
const version = `hyperspace/${require('./package.json').version} ${process.platform}-${process.arch} node-${process.version}`
3335

@@ -162,7 +164,8 @@ async function simulator () {
162164
process.once('SIGINT', close)
163165
process.once('SIGTERM', close)
164166

165-
const child = spawn(process.execPath, [scriptPath], {
167+
const childArgs = argv['--'] || []
168+
const child = spawn(process.execPath, [scriptPath, ...childArgs], {
166169
stdio: 'inherit'
167170
})
168171
child.on('close', close)

0 commit comments

Comments
 (0)