Permalink
Browse files

fix for GRAILS-8831 "Programmatic Build Not Picking Up Environment in…

… 2.0"
  • Loading branch information...
1 parent 6a362cf commit 5e026c8208c3b2b3272f1a059cc074b8e914867a @graemerocher graemerocher committed Apr 27, 2012
@@ -328,7 +328,10 @@ public int executeCommand(String scriptName, String args, String env) {
}
CommandLineParser parser = getCommandLineParser();
- CommandLine commandLine = parser.parseString(scriptName,args);
+ DefaultCommandLine commandLine = (DefaultCommandLine) parser.parseString(scriptName,args);
+ if(env != null) {
+ commandLine.setEnvironment(env);
+ }
return executeCommand(commandLine, scriptName, env);
}
@@ -45,6 +45,7 @@ public void addDeclaredOption(String name, Option option, Object value) {
public void setEnvironment(String environment) {
this.environment = environment;
+ System.setProperty(Environment.KEY, environment);
}
public void setCommand(String name) {

0 comments on commit 5e026c8

Please sign in to comment.