work on autotypist reset
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
ba825e7eb0
commit
ceaab24e56
2
draw.go
2
draw.go
|
@ -308,7 +308,7 @@ func (rs *RepoStatus) runGitCommands() bool {
|
|||
s := strings.Join(line, " ")
|
||||
log.Warn("NEED TO RUN:", s)
|
||||
rs.develMerge.SetText(s)
|
||||
err, b, output := runCmd(rs.repopath, line)
|
||||
err, b, output := RunCmd(rs.repopath, line)
|
||||
if err != nil {
|
||||
log.Warn("ABEND EXECUTION")
|
||||
log.Warn("error =", err)
|
||||
|
|
2
git.go
2
git.go
|
@ -206,7 +206,7 @@ func (rs *RepoStatus) CheckBranches() bool {
|
|||
}
|
||||
var cmd []string
|
||||
cmd = append(cmd, "git", "show", "-s", "--format=%ci", hash)
|
||||
_, _, output := runCmd(rs.repopath, cmd)
|
||||
_, _, output := RunCmd(rs.repopath, cmd)
|
||||
// git show -s --format=%ci <hash> will give you the time
|
||||
// log.Warn(fullfile)
|
||||
if hash == hashCheck {
|
||||
|
|
11
unix.go
11
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()
|
||||
|
|
Loading…
Reference in New Issue