return true;
}
private int run()
{
NodeEnvironment env = new NodeEnvironment();
try {
NodeScript ns;
if (scriptSource != null) {
// Force an "eval"
ns = env.createScript("[eval]", scriptSource, scriptArgs);
ns.setPrintEval(printEval);
} else {
ns = env.createScript(scriptArgs, runRepl);
}
ScriptStatus status;
try {
Future<ScriptStatus> future = ns.execute();
status = future.get();
} finally {
ns.close();
}
if (status.hasCause()) {
printException(status.getCause());
}
return status.getExitCode();
} catch (NodeException ne) {
ne.printStackTrace(System.err);
return 99;
} catch (InterruptedException ie) {
return 99;
} catch (ExecutionException ee) {
printException(ee.getCause());
return 99;
} finally {
env.close();
}
}