Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking for updates #31

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
Clean up error/warning messages for consistency
dborzov committed Oct 9, 2014
commit 9b45b52b6927e0e8cf4165870ca74b83fbbbcee7
2 changes: 1 addition & 1 deletion cmd/ipfs/ipfs.go
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ func localNode(confdir string, online bool) (*core.IpfsNode, error) {
if cfg.Version.Check == config.CheckError {
return nil, obsolete
}
fmt.Println(obsolete) // when "warn" version.check mode we just show warning message
log.Warning(fmt.Sprintf("%v", obsolete)) // when "warn" version.check mode we just show warning message
}
}

4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -47,8 +47,8 @@ func (bp *BootstrapPeer) String() string {

// 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
Check string // "ignore" for do not check, "warn" and "error" for reacting when obsolete
Current string // ipfs version for which config was generated
}

const (
3 changes: 2 additions & 1 deletion updates/updates.go
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import (
"os"

"github.com/coreos/go-semver/semver"
u "github.com/jbenet/go-ipfs/util"
)

const (
@@ -34,7 +35,7 @@ func init() {
var err error
currentVersion, err = semver.NewVersion(Version)
if err != nil {
fmt.Printf("The const Version literal in version.go needs to be in semver format: %s \n", Version)
u.PErr("The const Version literal in version.go needs to be in semver format: %s \n", Version)
os.Exit(1)
}
}