Skip to content

Commit

Permalink
fix: allow bit update outside of git repos!
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswalz committed Oct 20, 2020
1 parent d9f2268 commit 22c944f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 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.4`,
Long: `v0.7.5`,
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.4")
fmt.Println("bit version v0.7.5")
}
if isBranchChangeCommand(sub) {
branchName := ""
Expand Down
2 changes: 1 addition & 1 deletion cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
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.4")
fmt.Println("bit version v0.7.5")
PrintGitVersion()

}
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 22c944f

Please sign in to comment.