Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jan 31, 2016
1 parent 26448b7 commit 45088c7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ module.exports = {
opts['Addresses.Swarm'] = ['/ip4/0.0.0.0/tcp/0']
opts['Addresses.Gateway'] = ''
opts['Addresses.API'] = '/ip4/127.0.0.1/tcp/0'
const node = new Node(tempDir(), opts, true)
node.init(err => {
if (err) return done(err)
const node = new Node(opts.repoPath || tempDir(), opts, true)

if (typeof opts.init === 'boolean' && opts.init === false) {
done(null, node)
})
} else {
node.init(err => {
if (err) {
return done(err)
}
done(null, node)
})
}
}
}

0 comments on commit 45088c7

Please sign in to comment.