1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-28 00:39:31 +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.
cfg.Updates = config.Updates{
cfg.Version = config.Version{
Check: "error",
Version: currentVersion.String(),
Current: currentVersion.String(),
}
err = config.WriteConfigFile(filename, cfg)

View File

@ -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
}
}

View File

@ -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
}