Find git repositories within each directory
This commit is contained in:
parent
9560cf0f11
commit
d3475bdd8c
2 changed files with 61 additions and 1 deletions
20
internal/utils/path.go
Normal file
20
internal/utils/path.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ExpandPath(path string) (string, error) {
|
||||
if strings.HasPrefix(path, "~") {
|
||||
home, err := os.UserHomeDir()
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return strings.Replace(path, "~", home, 1), nil
|
||||
}
|
||||
|
||||
return path, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue