1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-23 00:37:48 +02:00

fix git remote user

This commit is contained in:
Lee Brown
2019-08-22 23:42:46 -08:00
parent c1f8b8f937
commit e8bf11c9d9

View File

@ -581,7 +581,6 @@ func gitRemoteUser(projectRoot string) string {
if ev := os.Getenv("CI_PROJECT_PATH"); ev != "" {
if strings.Contains(ev, "/") {
remoteUrl = strings.Split(ev, "/")[1]
remoteUrl = strings.Split(remoteUrl, "/")[0]
} else {
remoteUrl = ev
}
@ -599,7 +598,6 @@ func gitRemoteUser(projectRoot string) string {
break
}
}
}
if remoteUrl == "" {
return ""
@ -609,8 +607,11 @@ func gitRemoteUser(projectRoot string) string {
if !strings.Contains(remoteUrl, ":") {
return ""
}
remoteUser := strings.Split(remoteUrl, ":")[1]
remoteUser = strings.Split(remoteUser, "/")[0]
remoteUrl = strings.Split(remoteUrl, ":")[1]
}
remoteUser := strings.Split(remoteUrl, "/")[0]
return remoteUser
}