VirtualFile executableVirtualFile = LocalFileSystem.getInstance().findFileByPath(descriptorCopy.getExecutablePath());
if (executableVirtualFile == null || executableVirtualFile.isDirectory()) {
throw new ExecutionException(NginxBundle.message("run.error.badpath", descriptorCopy.getExecutablePath()));
}
PlatformDependentTools pdt = ApplicationManager.getApplication().getComponent(PlatformDependentTools.class);
ProcessBuilder builder = new ProcessBuilder(pdt.getStartCommand(descriptorCopy));
builder.directory(new File(executableVirtualFile.getParent().getPath()));
try {
return new NginxProcessHandler(builder.start(), StringUtil.join(pdt.getStartCommand(descriptorCopy), " "), descriptorCopy.clone());
} catch (IOException e) {
throw new ExecutionException(e.getMessage(), e);
}
}