strangely time.Sleep() doesn't work
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e741567fef
commit
1d2dacab26
9
unix.go
9
unix.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
@ -123,6 +124,11 @@ func runCmd(path string, parts []string) (error, bool, string) {
|
||||||
return RunCmd(fulldir, parts)
|
return RunCmd(fulldir, parts)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RunCmdNew(workingpath string, parts []string) (error, bool, string) {
|
||||||
|
time.Sleep(10 * time.Second)
|
||||||
|
return RunCmd(workingpath, parts)
|
||||||
|
}
|
||||||
|
|
||||||
func RunCmd(workingpath string, parts []string) (error, bool, string) {
|
func RunCmd(workingpath string, parts []string) (error, bool, string) {
|
||||||
if len(parts) == 0 {
|
if len(parts) == 0 {
|
||||||
log.Warn("command line was empty")
|
log.Warn("command line was empty")
|
||||||
|
@ -136,6 +142,9 @@ func RunCmd(workingpath string, parts []string) (error, bool, string) {
|
||||||
parts = parts[1:]
|
parts = parts[1:]
|
||||||
|
|
||||||
log.Warn("working path =", workingpath, "thing =", thing, "cmdline =", parts)
|
log.Warn("working path =", workingpath, "thing =", thing, "cmdline =", parts)
|
||||||
|
if thing == "pwd" {
|
||||||
|
os.Exit(-1)
|
||||||
|
}
|
||||||
// Create the command
|
// Create the command
|
||||||
cmd := exec.Command(thing, parts...)
|
cmd := exec.Command(thing, parts...)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue