diff --git a/src/bin/antRun b/src/bin/antRun index ac1a54d05..efc1dc8f9 100644 --- a/src/bin/antRun +++ b/src/bin/antRun @@ -10,5 +10,4 @@ if test -e $CMD.sh; then CMD="sh $CMD.sh" fi -echo $CMD $@ -$CMD $@ +echo $CMD $@ | sh diff --git a/src/main/org/apache/tools/ant/taskdefs/Exec.java b/src/main/org/apache/tools/ant/taskdefs/Exec.java index 431d52f2f..4d6d68c1f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Exec.java +++ b/src/main/org/apache/tools/ant/taskdefs/Exec.java @@ -67,12 +67,17 @@ import java.io.*; public class Exec extends Task { private String os; private String out; - private String dir; + private String dir = "."; private String command; private static final int BUFFER_SIZE = 512; public void execute() throws BuildException { + run(command); + } + + protected void run(String command) throws BuildException { + // test if os match String myos = System.getProperty("os.name"); project.log("Myos = " + myos, Project.MSG_VERBOSE); @@ -89,11 +94,6 @@ public class Exec extends Task { if (myos.toLowerCase().indexOf("windows") >= 0) antRun = antRun + ".bat"; command = antRun + " " + project.resolveFile(dir) + " " + command; - run(command); - } - - protected void run(String command) throws BuildException { - try { // show the command project.log(command, "exec", Project.MSG_VERBOSE);