1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 17:03:58 +08:00

Rename config.Updates to config.Version

This commit is contained in:
Peter Borzov
2014-10-07 09:41:26 -04:00
committed by Juan Batiz-Benet
parent bd9142f042
commit 4c167a42e2
3 changed files with 9 additions and 9 deletions

View File

@ -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. // 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", Check: "error",
Version: currentVersion.String(), Current: currentVersion.String(),
} }
err = config.WriteConfigFile(filename, cfg) err = config.WriteConfigFile(filename, cfg)

View File

@ -119,11 +119,11 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
return nil, err return nil, err
} }
if cfg.Updates.Check != "ignore" { if cfg.Version.Check != "ignore" {
obsolete := checkForUpdates() obsolete := checkForUpdates()
if obsolete != nil { if obsolete != nil {
fmt.Println(obsolete) fmt.Println(obsolete)
if cfg.Updates.Check == "error" { if cfg.Version.Check == "error" {
return nil, obsolete return nil, obsolete
} }
} }

View File

@ -45,10 +45,10 @@ func (bp *BootstrapPeer) String() string {
return bp.Address + "/" + bp.PeerID return bp.Address + "/" + bp.PeerID
} }
// Updates regulates checking and downloading for application's most recent version // Version regulates checking if the most recent version is run
type Updates struct { type Version struct {
Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete 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 Current string `json:"current"` // ipfs version for which config was generated
} }
// Config is used to load IPFS config files. // Config is used to load IPFS config files.
@ -57,7 +57,7 @@ type Config struct {
Datastore Datastore // local node's storage Datastore Datastore // local node's storage
Addresses Addresses // local node's addresses Addresses Addresses // local node's addresses
Mounts Mounts // local node's mount points 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 Bootstrap []*BootstrapPeer // local nodes's bootstrap peers
} }