From 4c167a42e2ef2d8d164aa534ea3d2450ce50a87e Mon Sep 17 00:00:00 2001 From: Peter Borzov Date: Tue, 7 Oct 2014 09:41:26 -0400 Subject: [PATCH] Rename config.Updates to config.Version --- cmd/ipfs/init.go | 4 ++-- cmd/ipfs/ipfs.go | 4 ++-- config/config.go | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 5243e3b1e..53d652d06 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -136,9 +136,9 @@ func initCmd(c *commander.Command, inp []string) error { } // tracking ipfs version used to generate the init folder and adding update checker default setting. - cfg.Updates = config.Updates{ + cfg.Version = config.Version{ Check: "error", - Version: currentVersion.String(), + Current: currentVersion.String(), } err = config.WriteConfigFile(filename, cfg) diff --git a/cmd/ipfs/ipfs.go b/cmd/ipfs/ipfs.go index fdc74c5f4..ee1ea6c46 100644 --- a/cmd/ipfs/ipfs.go +++ b/cmd/ipfs/ipfs.go @@ -119,11 +119,11 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) { return nil, err } - if cfg.Updates.Check != "ignore" { + if cfg.Version.Check != "ignore" { obsolete := checkForUpdates() if obsolete != nil { fmt.Println(obsolete) - if cfg.Updates.Check == "error" { + if cfg.Version.Check == "error" { return nil, obsolete } } diff --git a/config/config.go b/config/config.go index c68733991..4c47c3227 100644 --- a/config/config.go +++ b/config/config.go @@ -45,10 +45,10 @@ func (bp *BootstrapPeer) String() string { return bp.Address + "/" + bp.PeerID } -// Updates regulates checking and downloading for application's most recent version -type Updates struct { - Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete - Version string `json: "version"` // ipfs version for which config was generated +// Version regulates checking if the most recent version is run +type Version struct { + Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete + Current string `json:"current"` // ipfs version for which config was generated } // Config is used to load IPFS config files. @@ -57,7 +57,7 @@ type Config struct { Datastore Datastore // local node's storage Addresses Addresses // local node's addresses Mounts Mounts // local node's mount points - Updates Updates // local node's version management + Version Version // local node's version management Bootstrap []*BootstrapPeer // local nodes's bootstrap peers }