Skip to content

Commit

Permalink
FORGE-2137: ShellContext.isInteractive() now checks for the system pr…
Browse files Browse the repository at this point in the history
…operty
  • Loading branch information
gastaldi committed Nov 7, 2014
1 parent 6a8317e commit 646dd27
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public void startupDefaultShell(@Observes @Local PostStartup startup) throws Exc
Settings settings = new SettingsBuilder().inputStream(new ByteArrayInputStream(command.getBytes()))
.outputStream(System.out).outputStreamError(System.err).ansi(false).create();
this.shell = shellFactory.createShell(OperatingSystemUtils.getWorkingDir(), settings);
this.shell.getConsole().getExportManager().addVariable("export INTERACTIVE=false");
}
else if (Boolean.getBoolean("forge.standalone"))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public void close()
@Override
public boolean isInteractive()
{
String sysProp = System.getProperty("INTERACTIVE");
if (sysProp != null)
{
return Boolean.parseBoolean(sysProp);
}
Object interactiveFlag = getAttributeMap().get("INTERACTIVE");
return (interactiveFlag == null || "true".equalsIgnoreCase(interactiveFlag.toString()));
}
Expand Down

0 comments on commit 646dd27

Please sign in to comment.