Rename config.Updates to config.Version
Peter Borzov committed
Oct 7, 2014 at 09:41 UTC
4c167a42e2ef2d8d164aa534ea3d2450ce50a87e
3 files changed
+9
-9
cmd/ipfs/init.go
+2
-2
@@ -136,9 +136,9 @@ func initCmd(c *commander.Command, inp []string) error {
136
}
137
138
// tracking ipfs version used to generate the init folder and adding update checker default setting.
139
- cfg.Updates = config.Updates{
139
+ cfg.Version = config.Version{
140
Check: "error",
141
- Version: currentVersion.String(),
141
+ Current: currentVersion.String(),
142
}
143
144
err = config.WriteConfigFile(filename, cfg)
cmd/ipfs/ipfs.go
+2
-2
@@ -119,11 +119,11 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
119
return nil, err
120
}
121
122
- if cfg.Updates.Check != "ignore" {
122
+ if cfg.Version.Check != "ignore" {
123
obsolete := checkForUpdates()
124
if obsolete != nil {
125
fmt.Println(obsolete)
126
- if cfg.Updates.Check == "error" {
126
+ if cfg.Version.Check == "error" {
127
return nil, obsolete
128
}
129
}
config/config.go
+5
-5
@@ -45,10 +45,10 @@ func (bp *BootstrapPeer) String() string {
45
return bp.Address + "/" + bp.PeerID
46
}
47
48
-// Updates regulates checking and downloading for application's most recent version
49
-type Updates struct {
50
- Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete
51
- Version string `json: "version"` // ipfs version for which config was generated
48
+// Version regulates checking if the most recent version is run
49
+type Version struct {
50
+ Check string `json:"check"` // "ignore" for do not check, "warn" and "error" for reacting when obsolete
51
+ Current string `json:"current"` // ipfs version for which config was generated
52
}
53
54
// Config is used to load IPFS config files.
@@ -57,7 +57,7 @@ type Config struct {
57
Datastore Datastore // local node's storage
58
Addresses Addresses // local node's addresses
59
Mounts Mounts // local node's mount points
60
- Updates Updates // local node's version management
60
+ Version Version // local node's version management
61
Bootstrap []*BootstrapPeer // local nodes's bootstrap peers
62
}
63