diff --git a/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java b/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java index 83503c17351b..f828623194be 100644 --- a/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java +++ b/python/python-rest/src/com/jetbrains/rest/sphinx/SphinxBaseCommand.java @@ -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.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.newArrayList()); + } + } cmd.setWorkDirectory(service.getWorkdir().isEmpty()? module.getProject().getBaseDir().getPath(): service.getWorkdir()); PythonCommandLineState.createStandardGroups(cmd);