Skip to content

Commit 8909b65

Browse files
author
Joshua Anderson
committed
fix(client-go): fall back on directory name if remote can't be detected
1 parent 381e7ca commit 8909b65

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

client-go/pkg/git/git.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import (
44
"errors"
55
"fmt"
66
"io/ioutil"
7+
"os"
78
"os/exec"
9+
"path"
810
"strings"
911
)
1012

@@ -72,8 +74,10 @@ func remoteNameFromAppID(appID string) (string, error) {
7274
func DetectAppName(host string) (string, error) {
7375
remote, err := findRemote(host)
7476

77+
// Don't return an error if remote can't be found, return directory name instead.
7578
if err != nil {
76-
return "", err
79+
dir, err := os.Getwd()
80+
return strings.ToLower(path.Base(dir)), err
7781
}
7882

7983
ss := strings.Split(remote, "/")

0 commit comments

Comments
 (0)