提交 4f42a268 作者: Henry

fixed --force flag for shutdown after update

上级 d9552fea
......@@ -6,6 +6,10 @@ import (
"github.com/jbenet/go-ipfs/core/commands"
)
func init() {
cmdIpfsUpdate.Flag.Bool("force", false, "force shutdown of daemon when updating")
}
var cmdIpfsUpdate = &commander.Command{
UsageLine: "update",
Short: "check for updates and apply them",
......@@ -20,7 +24,7 @@ I wont even try, @jbenet. You do this much better :)`,
Run: makeCommand(command{
name: "updateApply",
args: 0,
flags: nil,
flags: []string{"force"},
online: true,
cmdFn: commands.UpdateApply,
}),
......
......@@ -25,13 +25,13 @@ func UpdateApply(n *core.IpfsNode, args []string, opts map[string]interface{}, o
fmt.Fprintln(out, "New Version:", u.Version)
_, onDaemon := opts["onDaemon"]
_, force := opts["force"]
force := opts["force"].(bool)
if onDaemon && !force {
return fmt.Errorf(`Error: update must stop running ipfs service.
You may want to abort the update, or shut the service down manually.
To shut it down automatically, run:
ipfs update apply -f
ipfs update --force
`)
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论