summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-03-01 21:45:06 -0600
committerJeff Carr <[email protected]>2024-03-01 21:45:06 -0600
commitb12bc0a9eca8c99f1840872aa838e5aa88edf3ec (patch)
tree727889095a8255a014272d90447d39c31fd2299e
parent4d2f68606ef8d2ff4ce388a8da0c2eae53c276a9 (diff)
export isGitDir()v0.21.2
-rw-r--r--common.go5
-rw-r--r--gitConfig.go6
2 files changed, 8 insertions, 3 deletions
diff --git a/common.go b/common.go
index e57409c..7daa87a 100644
--- a/common.go
+++ b/common.go
@@ -45,6 +45,11 @@ func (rs *RepoStatus) GoPath() string {
return rs.goPath.String()
}
+// full path
+func (rs *RepoStatus) FullPath() string {
+ return rs.realPath.String()
+}
+
func (rs *RepoStatus) IsPrimitive() bool {
if rs.primitive.String() == "true" {
return true
diff --git a/gitConfig.go b/gitConfig.go
index 03bac49..ce8834c 100644
--- a/gitConfig.go
+++ b/gitConfig.go
@@ -49,7 +49,7 @@ func ListGitDirectories() []string {
}
// Check if the current path is a directory and has a .git subdirectory
- if info.IsDir() && isGitDir(path) {
+ if info.IsDir() && IsGitDir(path) {
all = append(all, path)
// fmt.Println(path)
}
@@ -64,8 +64,8 @@ func ListGitDirectories() []string {
return all
}
-// isGitDir checks if a .git directory exists inside the given directory
-func isGitDir(dir string) bool {
+// IsGitDir checks if a .git directory exists inside the given directory
+func IsGitDir(dir string) bool {
gitDir := filepath.Join(dir, ".git")
info, err := os.Stat(gitDir)
if os.IsNotExist(err) {