private GeneralCommandLine getCommandForNeko(@Nullable HaxeSdkData sdkData, HaxeModuleSettings settings) throws ExecutionException {
if (sdkData == null || sdkData.getNekoBinPath() == null || sdkData.getNekoBinPath().isEmpty()) {
throw new ExecutionException(HaxeBundle.message("haxe.run.bad.neko.bin.path"));
}
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(sdkData.getNekoBinPath());
//commandLine.setWorkDirectory(PathUtil.getParentPath(module.getModuleFilePath()));
//Get output path provided in settings
//Neko is always compiled to /release/ folder
String workDirectory = settings.getOutputFolder() + "/release/";
commandLine.setWorkDirectory(workDirectory);
if (customFileToLaunch != null) {
commandLine.addParameter(customFileToLaunch);
}
else {
final VirtualFile outputDirectory = CompilerPaths.getModuleOutputDirectory(module, false);
final VirtualFile fileToLaunch = outputDirectory != null ? outputDirectory.findChild(settings.getOutputFileName()) : null;
String outputFileName = settings.getOutputFileName();
if (fileToLaunch != null) {
commandLine.addParameter(fileToLaunch.getPath());
}
else if (outputFileName != null) {
commandLine.addParameter(outputFileName);
}
}
//Make sure to have one command line parameter which contains file name
assert commandLine.getParametersList().getArray().length == 1;
final TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(module.getProject());
setConsoleBuilder(consoleBuilder);
return commandLine;
}