summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-01 11:44:02 -0600
committerJeff Carr <[email protected]>2024-12-01 11:44:02 -0600
commiteee35998d0ce4fd19f9989e396a51902e3690ef4 (patch)
tree54d87e4c1e77e87db7a4b3efa6783c03c0b0f9b9
parentfb792e13a7acdeafcacb2d37139bf5653b16921a (diff)
IsDirectory() checkv0.22.20
-rw-r--r--Makefile2
-rw-r--r--newRepo.go9
2 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 126787b..3d7ebae 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
all:
@GO111MODULE=off go vet
@echo go vet: this go library package builds okay
+
+test:
make -C testGui
goimports:
diff --git a/newRepo.go b/newRepo.go
index 0932ed6..3dbde0e 100644
--- a/newRepo.go
+++ b/newRepo.go
@@ -1,6 +1,8 @@
package repolist
import (
+ "errors"
+
"go.wit.com/lib/gui/repostatus"
"go.wit.com/lib/protobuf/gitpb"
"go.wit.com/log"
@@ -60,9 +62,14 @@ func (r *RepoRow) Show2() {
// adds a gui row to the table based off the repo protobuf
func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
+ if !pb.IsDirectory() {
+ // this directory doesn't exist anymore
+ // was moved, or isn't in the ~/go/src or wherever go.work is
+ return nil, errors.New("path is gone: " + pb.FullPath)
+ }
test, ok := r.allrepos[pb.GetGoPath()]
if ok {
- // this repo already exists
+ // this repo gopath was already added
return test, nil
}