Skip to content

Commit

Permalink
fix: fix ipfsd.init return value (#291)
Browse files Browse the repository at this point in the history
init should return ipfsd instance in the callback but didn't

closes #289
  • Loading branch information
hugomrdias authored Aug 29, 2018
1 parent 5de0ada commit 3fa63e3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Initialize a repo.
- `directory` (default IPFS_PATH if defined, or ~/.ipfs for go-ipfs and ~/.jsipfs for js-ipfs) - The location of the repo.
- `pass` (optional) - The passphrase of the key chain.

`callback` is a function with the signature `function (Error, ipfsd)` where `err` is an Error in case something goes wrong and `ipfsd` is the daemon controller instance.
`callback` is a function with the signature `function (err, ipfsd)` where `err` is an Error in case something goes wrong and `ipfsd` is the daemon controller instance.

#### `ipfsd.cleanup(callback)`

Expand All @@ -215,7 +215,7 @@ Start the daemon.

`flags` - Flags array to be passed to the `ipfs daemon` command.

`callback` is a function with the signature `function(err, ipfsApi)` that receives an instance of `ipfs-api` on success or an instance of `Error` on failure
`callback` is a function with the signature `function(err, ipfsApi)` that receives an instance of `Error` on failure or an instance of `ipfs-api` on success.


#### `ipfsd.stop([timeout, callback])`
Expand Down
2 changes: 1 addition & 1 deletion src/ipfsd-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DaemonClient {
}

this.initialized = res.body.initialized
cb()
cb(null, this)
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/ipfsd-daemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Daemon {
if (err) { return callback(err) }
this.clean = false
this.initialized = true
return callback()
return callback(null, this)
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/ipfsd-in-proc.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Node extends EventEmitter {
if (err) { return callback(err) }
self.clean = false
self.initialized = true
return callback()
return callback(null, this)
})
})
}
Expand Down

0 comments on commit 3fa63e3

Please sign in to comment.