summaryrefslogtreecommitdiff
path: root/new.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-23 11:00:33 -0600
committerJeff Carr <[email protected]>2024-02-23 11:00:33 -0600
commit28a20e09220d5191f8920d7bd78c961ae9cd05e0 (patch)
treee6b294e8e6a3743188a79e1cdd93c5cb43eec04a /new.go
parent5268267408166a8b6d80ada8231399d657a21243 (diff)
add repo.IsPrivate()v0.20.10
Diffstat (limited to 'new.go')
-rw-r--r--new.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/new.go b/new.go
index c333e24..4e4403c 100644
--- a/new.go
+++ b/new.go
@@ -1,6 +1,7 @@
package repostatus
import (
+ "errors"
"os"
"path/filepath"
"strings"
@@ -47,7 +48,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
if windowMap[path] == nil {
log.Log(INFO, "NewRepoStatusWindow() adding new", path)
} else {
- log.Warn("This already exists yet for path", path)
+ log.Warn("This already exists for path", path)
log.Warn("should return windowMap[path] here")
return nil, windowMap[path]
}
@@ -74,6 +75,11 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
realpath = filepath.Join(goSrcDir, path)
isGoLang = true
}
+ if !IsDirectory(realpath) {
+ log.Log(REPOWARN, "directory doesn't exist", realpath)
+ // directory doesn't exist. exit with nil and error nil
+ return errors.New(realpath + " does not exist"), nil
+ }
filename := filepath.Join(realpath, ".git/config")
@@ -120,6 +126,7 @@ func NewRepoStatusWindow(path string) (error, *RepoStatus) {
rs.readOnly.SetValue("true")
// ignore everything else for now
+ // todo: move this logic to cfgfile.go
if strings.HasPrefix(path, "go.wit.com") {
rs.readOnly.SetValue("false")
}