From d904d0c097e16f9f0e9ebc9f90a3a9391fb57f7b Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Sun, 30 Jan 2000 16:20:24 +0000 Subject: [PATCH] Ensure quoted strings for javadoc are interpreted properly by the shell git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267577 13f79535-47bb-0310-9956-ffa450edef68 --- src/bin/antRun | 3 +-- src/main/org/apache/tools/ant/taskdefs/Exec.java | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) 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);