* print cmd/args as part of the error message

This commit is contained in:
Reinhard Pointner 2011-12-03 02:50:09 +00:00
parent 5e0dcb73f0
commit 732cd946a3
1 changed files with 5 additions and 5 deletions

View File

@ -44,17 +44,17 @@ List.metaClass.mapByExtension = { mapByExtension(delegate) }
import static com.sun.jna.Platform.*; import static com.sun.jna.Platform.*;
def execute(String... args) { def execute(String... args) {
if (!_args.trustScript) {
_log.severe("Execute failed: Script is not trusted");
return -1
}
def cmd = args.toList() def cmd = args.toList()
if (isWindows()) { if (isWindows()) {
// normalize file separator for windows and run with cmd so any executable in PATH will just work // normalize file separator for windows and run with cmd so any executable in PATH will just work
cmd = ['cmd', '/c'] + cmd*.replace('/','\\') cmd = ['cmd', '/c'] + cmd*.replace('/','\\')
} }
if (!_args.trustScript) {
_log.severe("Execute failed: Script is not trusted: " + cmd)
return -1
}
// run command and print output // run command and print output
def process = cmd.execute() def process = cmd.execute()
process.waitForProcessOutput(System.out, System.err) process.waitForProcessOutput(System.out, System.err)