Skip to content

Commit e2d2841

Browse files
committed
fix: fix the args handling
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']
1 parent 6d193a4 commit e2d2841

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ipfsd-in-proc.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InProc {
3030

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

33-
this.opts.args.forEach((arg) => {
33+
this.opts.args.forEach((arg, index) => {
3434
if (arg === '--enable-sharding-experiment') {
3535
this.opts.EXPERIMENTAL.sharding = true
3636
} else if (arg === '--enable-namesys-pubsub') {
@@ -40,9 +40,7 @@ class InProc {
4040
} else if (arg === '--offline') {
4141
this.opts.offline = true
4242
} else if (arg.startsWith('--pass')) {
43-
this.opts.pass = arg.split(' ').slice(1).join(' ')
44-
} else {
45-
throw new Error(`Unknown argument ${arg}`)
43+
this.opts.pass = this.opts.args[index + 1]
4644
}
4745
})
4846
}

0 commit comments

Comments
 (0)