Commit b6081be3 authored by Steven Allen's avatar Steven Allen

only construct a node in online mode when running external commands.

This breaks commands like `ipfs update` that expect IPFS to *not* be running.

fixes #5191

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 7e8f6c96
......@@ -52,8 +52,16 @@ func ExternalBinary() *cmds.Command {
// setup env of child program
env := os.Environ()
nd, err := req.InvocContext().GetNode()
if err == nil {
// Get the node iff already defined.
if req.InvocContext().Online {
nd, err := req.InvocContext().GetNode()
if err != nil {
res.SetError(fmt.Errorf(
"failed to start ipfs node: %s",
err,
), cmdkit.ErrFatal)
return
}
env = append(env, fmt.Sprintf("IPFS_ONLINE=%t", nd.OnlineMode()))
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment