summaryrefslogtreecommitdiff
path: root/unix.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-15 08:12:04 -0600
committerJeff Carr <[email protected]>2024-01-15 08:12:04 -0600
commitceaab24e56b13a1118a38dbf5dc5e5023d6ec4a9 (patch)
tree7d45c9092c6bbb5ea96e3b7bb1124988434b62ae /unix.go
parentba825e7eb06ca8aa57c7dc07358e2cf902b2f5ec (diff)
work on autotypist reset
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'unix.go')
-rw-r--r--unix.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/unix.go b/unix.go
index e28ce07..05bd372 100644
--- a/unix.go
+++ b/unix.go
@@ -116,6 +116,11 @@ func splitVersion(version string) (a, b, c string) {
}
func runCmd(path string, parts []string) (error, bool, string) {
+ fulldir := fullpath(path)
+ return RunCmd(fulldir, parts)
+}
+
+func RunCmd(workingpath string, parts []string) (error, bool, string) {
if len(parts) == 0 {
log.Warn("command line was empty")
return errors.New("empty"), false, ""
@@ -127,12 +132,12 @@ func runCmd(path string, parts []string) (error, bool, string) {
thing := parts[0]
parts = parts[1:]
- log.Verbose("path =", path, "thing =", thing, "cmdline =", parts)
+ log.Warn("working path =", workingpath, "thing =", thing, "cmdline =", parts)
// Create the command
cmd := exec.Command(thing, parts...)
// Set the working directory
- cmd.Dir = fullpath(path)
+ cmd.Dir = workingpath
// Execute the command
output, err := cmd.CombinedOutput()
@@ -170,8 +175,6 @@ func IsDirectory(path string) bool {
return info.IsDir()
}
-
-
func VerifyLocalGoRepo(gorepo string) bool {
// Get current user
usr, err := user.Current()