fixed PY-15718 IPython Notebook: invalid project selected as serving directory in multi-project structure

This commit is contained in:
Ekaterina Tuzova
2016-03-03 18:09:31 +03:00
parent 6f97c6ff0d
commit ce7bf477b1
@@ -14,6 +14,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.ui.InputValidator;
import com.intellij.openapi.ui.MessageType;
@@ -311,7 +312,8 @@ public final class IpnbConnectionManager implements ProjectComponent {
parameters.add("--port");
parameters.add(hostPort.getSecond());
}
final GeneralCommandLine commandLine = new GeneralCommandLine(parameters).withWorkDirectory(myProject.getBasePath());
final String baseDir = ModuleRootManager.getInstance(module).getContentRoots()[0].getCanonicalPath();
final GeneralCommandLine commandLine = new GeneralCommandLine(parameters).withWorkDirectory(baseDir);
if (env != null) {
commandLine.withEnvironment(env);
}