normalize git remote in cli, fix typo

pull/123/head
Simon Let 6 years ago
parent f18b3afa5c
commit 282f3bd759
  1. 3
      cmd/cli/main.go
  2. 2
      pkg/records/records.go

@ -86,7 +86,6 @@ func runReshCli() (string, int) {
log.Println("Error: you need to specify gitOriginRemote") log.Println("Error: you need to specify gitOriginRemote")
} }
log.Printf("gitRemoteOrigin: %s\n", *gitOriginRemote)
g, err := gocui.NewGui(gocui.OutputNormal, false) g, err := gocui.NewGui(gocui.OutputNormal, false)
if err != nil { if err != nil {
log.Panicln(err) log.Panicln(err)
@ -114,7 +113,7 @@ func runReshCli() (string, int) {
sessionID: *sessionID, sessionID: *sessionID,
host: *host, host: *host,
pwd: *pwd, pwd: *pwd,
gitOriginRemote: *gitOriginRemote, gitOriginRemote: records.NormalizeGitRemote(*gitOriginRemote),
config: config, config: config,
s: &st, s: &st,
} }

@ -328,7 +328,7 @@ func GetCommandAndFirstWord(cmdLine string) (string, string, error) {
return "ERROR", "ERROR", errors.New("this should not happen - contact developer ;)") return "ERROR", "ERROR", errors.New("this should not happen - contact developer ;)")
} }
// NormalizeGitRomote func // NormalizeGitRemote func
func NormalizeGitRemote(gitRemote string) string { func NormalizeGitRemote(gitRemote string) string {
if strings.HasSuffix(gitRemote, ".git") { if strings.HasSuffix(gitRemote, ".git") {
return gitRemote[:len(gitRemote)-4] return gitRemote[:len(gitRemote)-4]

Loading…
Cancel
Save