fixed PY-16234 sphinx-quickstart doesn't find Sphinx although it is installed

This commit is contained in:
Ekaterina Tuzova
2015-11-10 19:06:05 +03:00
parent 37310a619a
commit 1b03cec221
@@ -29,6 +29,7 @@ import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.jetbrains.python.PythonHelper;
@@ -148,7 +149,17 @@ public class SphinxBaseCommand {
String sdkHomePath = sdk.getHomePath();
final GeneralCommandLine cmd = PythonHelper.LOAD_ENTRY_POINT.newCommandLine(sdkHomePath, Lists.<String>newArrayList());
GeneralCommandLine cmd = new GeneralCommandLine();
if (sdkHomePath != null) {
final String runnerName = "sphinx-quickstart" + (SystemInfo.isWindows ? ".exe" : "");
String executablePath = PythonSdkType.getExecutablePath(sdkHomePath, runnerName);
if (executablePath != null) {
cmd.setExePath(executablePath);
}
else {
cmd = PythonHelper.LOAD_ENTRY_POINT.newCommandLine(sdkHomePath, Lists.<String>newArrayList());
}
}
cmd.setWorkDirectory(service.getWorkdir().isEmpty()? module.getProject().getBaseDir().getPath(): service.getWorkdir());
PythonCommandLineState.createStandardGroups(cmd);