Commit 4c167a42 authored by Peter Borzov's avatar Peter Borzov Committed by Juan Batiz-Benet

Rename config.Updates to config.Version

parent bd9142f0
......@@ -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)
......
......@@ -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
}
}
......
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment