diff --git a/cmd/ipfs2/main.go b/cmd/ipfs2/main.go index f045aa2f8..4bbe1da92 100644 --- a/cmd/ipfs2/main.go +++ b/cmd/ipfs2/main.go @@ -15,9 +15,10 @@ import ( cmds "github.com/jbenet/go-ipfs/commands" cmdsCli "github.com/jbenet/go-ipfs/commands/cli" cmdsHttp "github.com/jbenet/go-ipfs/commands/http" - "github.com/jbenet/go-ipfs/config" - "github.com/jbenet/go-ipfs/core" + config "github.com/jbenet/go-ipfs/config" + core "github.com/jbenet/go-ipfs/core" daemon "github.com/jbenet/go-ipfs/daemon2" + updates "github.com/jbenet/go-ipfs/updates" u "github.com/jbenet/go-ipfs/util" ) @@ -207,12 +208,12 @@ func callCommand(req cmds.Request, root *cmds.Command) (cmds.Response, error) { return nil, err } - if useDaemon { + cfg, err := req.Context().GetConfig() + if err != nil { + return nil, err + } - cfg, err := req.Context().GetConfig() - if err != nil { - return nil, err - } + if useDaemon { addr, err := ma.NewMultiaddr(cfg.Addresses.API) if err != nil { @@ -235,6 +236,11 @@ func callCommand(req cmds.Request, root *cmds.Command) (cmds.Response, error) { } else { log.Info("Executing command locally") + // Check for updates and potentially install one. + if err := updates.CliCheckForUpdates(cfg, req.Context().ConfigRoot); err != nil { + return nil, err + } + // this sets up the function that will initialize the node // this is so that we can construct the node lazily. ctx := req.Context() diff --git a/config/version.go b/config/version.go index 8a659cd68..62cacfa49 100644 --- a/config/version.go +++ b/config/version.go @@ -8,7 +8,7 @@ import ( ) // CurrentVersionNumber is the current application's version literal -const CurrentVersionNumber = "0.1.6" +const CurrentVersionNumber = "0.1.7" // Version regulates checking if the most recent version is run type Version struct { diff --git a/updates/updates.go b/updates/updates.go index e7b6054d9..604a38d81 100644 --- a/updates/updates.go +++ b/updates/updates.go @@ -200,7 +200,7 @@ func CliCheckForUpdates(cfg *config.Config, confFile string) error { // if config says not to, don't check for updates if !cfg.Version.ShouldCheckForUpdate() { - log.Info("update checking disabled.") + log.Info("update check skipped.") return nil }