* print cmd/args as part of the error message
This commit is contained in:
parent
5e0dcb73f0
commit
732cd946a3
|
@ -44,17 +44,17 @@ List.metaClass.mapByExtension = { mapByExtension(delegate) }
|
|||
import static com.sun.jna.Platform.*;
|
||||
|
||||
def execute(String... args) {
|
||||
if (!_args.trustScript) {
|
||||
_log.severe("Execute failed: Script is not trusted");
|
||||
return -1
|
||||
}
|
||||
|
||||
def cmd = args.toList()
|
||||
if (isWindows()) {
|
||||
// normalize file separator for windows and run with cmd so any executable in PATH will just work
|
||||
cmd = ['cmd', '/c'] + cmd*.replace('/','\\')
|
||||
}
|
||||
|
||||
if (!_args.trustScript) {
|
||||
_log.severe("Execute failed: Script is not trusted: " + cmd)
|
||||
return -1
|
||||
}
|
||||
|
||||
// run command and print output
|
||||
def process = cmd.execute()
|
||||
process.waitForProcessOutput(System.out, System.err)
|
||||
|
|
Loading…
Reference in New Issue