提交 b6081be3 作者: 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: 's avatarSteven Allen <steven@stebalien.com>
上级 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 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论