@cryptotaxi247 / kubo / commits / 4f42a2683

fixed --force flag for shutdown after update

Henry committed Oct 22, 2014 at 12:42 UTC 4f42a26836fe9e38325ff8c2ec20829a04a1b259
2 files changed +7 -3
cmd/ipfs/update.go
+5 -1
@@ -6,6 +6,10 @@ import (
6 "github.com/jbenet/go-ipfs/core/commands"
7 )
8
9 +func init() {
10 + cmdIpfsUpdate.Flag.Bool("force", false, "force shutdown of daemon when updating")
11 +}
12 +
13 var cmdIpfsUpdate = &commander.Command{
14 UsageLine: "update",
15 Short: "check for updates and apply them",
@@ -20,7 +24,7 @@ I wont even try, @jbenet. You do this much better :)`,
24 Run: makeCommand(command{
25 name: "updateApply",
26 args: 0,
23 - flags: nil,
27 + flags: []string{"force"},
28 online: true,
29 cmdFn: commands.UpdateApply,
30 }),
core/commands/update.go
+2 -2
@@ -25,13 +25,13 @@ func UpdateApply(n *core.IpfsNode, args []string, opts map[string]interface{}, o
25 fmt.Fprintln(out, "New Version:", u.Version)
26
27 _, onDaemon := opts["onDaemon"]
28 - _, force := opts["force"]
28 + force := opts["force"].(bool)
29 if onDaemon && !force {
30 return fmt.Errorf(`Error: update must stop running ipfs service.
31 You may want to abort the update, or shut the service down manually.
32 To shut it down automatically, run:
33
34 - ipfs update apply -f
34 + ipfs update --force
35 `)
36 }
37