Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/in-proc-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,22 @@ class Node {
}
})

this.opts.EXPERIMENTAL.pubsub = (this.opts.args.indexOf('--enable-pubsub-experiment') > -1)
this.opts.EXPERIMENTAL.sharding = (this.opts.args.indexOf('--enable-sharding-experiment') > -1)
this.opts.args.forEach((arg) => {
if (arg === '--enable-pubsub-experiment') {
this.opts.EXPERIMENTAL.pubsub = true
} else if (arg === '--enable-sharding-experiment') {
this.opts.EXPERIMENTAL.sharding = true
} else if (arg.startsWith('--pass')) {
this.opts.pass = arg.split(' ').slice(1).join(' ')
} else {
throw new Error('Unkown argument ' + arg)
}
})
this.exec = new IPFS({
repo: this.repo,
init: false,
start: false,
pass: this.opts.pass,
EXPERIMENTAL: this.opts.EXPERIMENTAL,
libp2p: this.opts.libp2p
})
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ exports.findIpfsExecutable = (type, rootPath) => {

function run (node, args, opts, callback) {
let executable = node.exec
if (isWindows && node.opts.type !== 'go') {
if (isWindows && executable.endsWith('.js')) {
args = args || []
args.unshift(node.exec)
executable = process.execPath
Expand Down