From 22c944fb861268489d79728dd6f0ff7d64229a40 Mon Sep 17 00:00:00 2001 From: chriswalz Date: Mon, 19 Oct 2020 23:53:42 -0400 Subject: [PATCH] fix: allow bit update outside of git repos! --- cmd/rootShell.go | 4 ++-- cmd/update.go | 2 +- cmd/util.go | 2 +- main.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/rootShell.go b/cmd/rootShell.go index 3c39081..a3fef8e 100644 --- a/cmd/rootShell.go +++ b/cmd/rootShell.go @@ -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.4`, + Long: `v0.7.5`, Run: func(cmd *cobra.Command, args []string) { completerSuggestionMap, bitCmdMap := CreateSuggestionMap(cmd) @@ -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.4") + fmt.Println("bit version v0.7.5") } if isBranchChangeCommand(sub) { branchName := "" diff --git a/cmd/update.go b/cmd/update.go index 8c386db..5e153d4 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -23,7 +23,7 @@ bit update v0.7.4 (note: v is required)`, targetVersion = args[0][1:] } - currentVersion := "v0.7.4" + currentVersion := "v0.7.5" // open-source edition p := &update.Manager{ diff --git a/cmd/util.go b/cmd/util.go index 6a6e5f3..9733f09 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -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.4") + fmt.Println("bit version v0.7.5") PrintGitVersion() } diff --git a/main.go b/main.go index 11ed533..715ae49 100644 --- a/main.go +++ b/main.go @@ -39,9 +39,9 @@ func main() { } // verify is git repo - if !bitcmd.IsGitRepo() { + if !bitcmd.IsGitRepo() && os.Args[1] != "update" { if len(os.Args) == 2 && os.Args[1] == "--version" { - fmt.Println("bit version v0.7.4") + fmt.Println("bit version v0.7.5") bitcmd.PrintGitVersion() return }