Skip to content

Commit

Permalink
fix case where nil release can mean up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Oct 20, 2020
1 parent 3b11b4e commit d9f2268
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cmd/rootShell.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var ShellCmd = &cobra.Command{
Use: "bit",
Short: "Bit is a Git CLI that predicts what you want to do",
Long: `v0.7.3`,
Long: `v0.7.4`,
Run: func(cmd *cobra.Command, args []string) {
completerSuggestionMap, bitCmdMap := CreateSuggestionMap(cmd)

Expand Down Expand Up @@ -141,7 +141,7 @@ func GitCommandsPromptUsed(args []string, suggestionMap map[string][]prompt.Sugg
// expected usage format
// bit (checkout|switch|co) [-b] branch-name
if args[len(args)-1] == "--version" {
fmt.Println("bit version v0.7.3")
fmt.Println("bit version v0.7.4")
}
if isBranchChangeCommand(sub) {
branchName := ""
Expand Down
8 changes: 4 additions & 4 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ var updateCmd = &cobra.Command{
Use: "update",
Short: "Updates bit to the latest or specified version",
Long: `bit update
bit update v0.7.3 (note: v is required)`,
bit update v0.7.4 (note: v is required)`,
Run: func(cmd *cobra.Command, args []string) {
targetVersion := ""
if len(args) == 1 {
targetVersion = args[0][1:]
}

currentVersion := "v0.7.3"
currentVersion := "v0.7.4"

// open-source edition
p := &update.Manager{
Expand All @@ -43,8 +43,8 @@ bit update v0.7.3 (note: v is required)`,
}

// no updates
if currentVersion == release.Version {
fmt.Println("No updates available, you're good :)")
if release == nil || currentVersion == release.Version {
fmt.Println("No updates available, update to date!")
return
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func HandleExit() {
fmt.Println(v)
fmt.Println(string(debug.Stack()))
fmt.Println("OS:", runtime.GOOS, runtime.GOARCH)
fmt.Println("bit version v0.7.3")
fmt.Println("bit version v0.7.4")
PrintGitVersion()

}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func main() {
// verify is git repo
if !bitcmd.IsGitRepo() {
if len(os.Args) == 2 && os.Args[1] == "--version" {
fmt.Println("bit version v0.7.3")
fmt.Println("bit version v0.7.4")
bitcmd.PrintGitVersion()
return
}
Expand Down

0 comments on commit d9f2268

Please sign in to comment.