Skip to content

Commit

Permalink
fix(cmd): Fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed May 16, 2018
1 parent 58e174a commit 604b036
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions cmd/fossa/cmd/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ func Do(c *cli.Context) {

ok, err := AvailableUpdate()
if err != nil {
log.Fatalf("Unable to update: %s", err.Error())
log.Logger.Fatalf("Unable to update: %s", err.Error())
}
if !ok {
log.Fatalf("No updates available")
log.Logger.Fatalf("No updates available")
}

version, err := Update()
if err != nil {
log.Fatalf("Update failed: %s", err.Error())
log.Logger.Fatalf("Update failed: %s", err.Error())
}

log.Notice("fossa has been updated to " + version.String())
log.Logger.Notice("fossa has been updated to " + version.String())
}

func AvailableUpdate() (bool, error) {
Expand Down
18 changes: 9 additions & 9 deletions cmd/fossa/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@ import (
)

var (
BuildType string
Version string
Commit string
GoVersion string
buildType string
version string
commit string
goversion string
)

var ErrIsDevelopment = errors.New("this development binary has no semantic version")

func IsDevelopment() bool {
return BuildType == "development"
return buildType == "development"
}

func String() string {
return fmt.Sprintf("%s (revision %s compiled with %s)", Version, Commit, GoVersion)
return fmt.Sprintf("%s (revision %s compiled with %s)", version, commit, goversion)
}

func ShortString() string {
if IsDevelopment() {
return Commit
return commit
}
return Version
return version
}

func Semver() (semver.Version, error) {
if IsDevelopment() {
return semver.Version{}, ErrIsDevelopment
}
return semver.Parse(strings.TrimPrefix(Version, "v"))
return semver.Parse(strings.TrimPrefix(version, "v"))
}

0 comments on commit 604b036

Please sign in to comment.