summaryrefslogtreecommitdiff
path: root/new.go
diff options
context:
space:
mode:
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")
}