Browse Source

If directory is specified test if it's a valid one.

Submitted By: "Nico Seessle" <Nico.Seessle@epost.de>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268493 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
021634e2bb
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/main/org/apache/tools/ant/taskdefs/ExecTask.java

+ 6
- 0
src/main/org/apache/tools/ant/taskdefs/ExecTask.java View File

@@ -170,6 +170,12 @@ public class ExecTask extends Task {
if (cmdl.getExecutable() == null) { if (cmdl.getExecutable() == null) {
throw new BuildException("no executable specified", location); throw new BuildException("no executable specified", location);
} }
if (dir != null && !dir.exists()) {
throw new BuildException("The directory you specified does not exist");
}
if (dir != null && !dir.isDirectory()) {
throw new BuildException("The directory you specified is not a directory");
}
} }


/** /**


Loading…
Cancel
Save