Skip to content

Commit

Permalink
fix: fix the args handling
Browse files Browse the repository at this point in the history
we supported ['--pass some-string'] which is not very common in any process spawning lib so now we only support the common syntax which is ['--pass', 'some-string']
  • Loading branch information
hugomrdias committed Oct 14, 2019
1 parent 6d193a4 commit e2d2841
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/ipfsd-in-proc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class InProc {

this.opts.EXPERIMENTAL = merge({ sharding: false }, opts.EXPERIMENTAL)

this.opts.args.forEach((arg) => {
this.opts.args.forEach((arg, index) => {
if (arg === '--enable-sharding-experiment') {
this.opts.EXPERIMENTAL.sharding = true
} else if (arg === '--enable-namesys-pubsub') {
Expand All @@ -40,9 +40,7 @@ class InProc {
} else if (arg === '--offline') {
this.opts.offline = true
} else if (arg.startsWith('--pass')) {
this.opts.pass = arg.split(' ').slice(1).join(' ')
} else {
throw new Error(`Unknown argument ${arg}`)
this.opts.pass = this.opts.args[index + 1]
}
})
}
Expand Down

0 comments on commit e2d2841

Please sign in to comment.