X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=run.go;h=07882cdd71949f58774c8d8301edcb9a8adbf9d5;hb=a9278680413807017c52f41920a307e695060bc2;hp=2efd2d31a80e20917f0ee89a027da0f10354ddca;hpb=663a0b42bef23f4ead253f55b3e2db158eac3585;p=goredo.git diff --git a/run.go b/run.go index 2efd2d3..07882cd 100644 --- a/run.go +++ b/run.go @@ -67,6 +67,8 @@ var ( flagTraceAll = flag.Bool("xx", false, fmt.Sprintf("trace (sh -x) all targets (%s=1)", EnvTrace)) flagStderrKeep = flag.Bool("logs", false, fmt.Sprintf("keep job's stderr (%s=1)", EnvStderrKeep)) flagStderrSilent = flag.Bool("silent", false, fmt.Sprintf("do not print job's stderr (%s=1)", EnvStderrSilent)) + + TracedAll bool ) type RunErr struct { @@ -304,7 +306,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error { args = make([]string, 0, 3) } else { cmdName = "/bin/sh" - if traced { + if traced || TracedAll { args = append(args, "-ex") } else { args = append(args, "-e") @@ -466,7 +468,7 @@ func runScript(tgtOrig string, errs chan error, traced bool) error { if fdStderr != nil { ts.FromTime(time.Now()) LogMutex.Lock() - fmt.Fprintf(fdStderr, "%s %s\n", tai64n.Encode(ts[:]), line) + fmt.Fprintln(fdStderr, tai64n.Encode(ts[:]), line) LogMutex.Unlock() } if StderrSilent {