Added code to check if "cmd" attribute is valid or not. This is to make error report more accurate.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1702 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
jwang36 2006-10-10 05:55:36 +00:00
parent fd6c41f5e2
commit 63cdbe79b1
1 changed files with 7 additions and 0 deletions

View File

@ -227,6 +227,13 @@ public class UserDefineDef extends ProcessorDef {
if (isReference()) {
throw tooManyAttributes();
}
if (cmd == null || cmd.trim().length() == 0) {
throw new BuildException("cmd attribute is empty!");
}
File cmdProgram = new File(cmd);
if (cmdProgram.isDirectory()) {
throw new BuildException(cmd + " is not valid or executable!");
}
this.cmd = cmd;
}