Skip to content

Commit a21398d

Browse files
committed
add menu item to launch web app from environment menu
1 parent e3b9059 commit a21398d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/main/pythonenvdialog/pythonenvdialog.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,37 @@ export class ManagePythonEnvironmentDialog {
137137
launchTerminalInDirectory(envPath, activateCommand);
138138
}
139139
},
140+
{
141+
label: 'Launch JupyterLab Web App',
142+
click: async () => {
143+
const { filePaths } = await dialog.showOpenDialog({
144+
title: 'Choose working directory',
145+
properties: [
146+
'showHiddenFiles',
147+
'noResolveAliases',
148+
'openDirectory',
149+
'createDirectory'
150+
],
151+
buttonLabel: 'Launch'
152+
});
153+
154+
if (filePaths.length === 0) {
155+
return;
156+
}
157+
158+
const workingDir = filePaths[0];
159+
160+
const condaPath = getCondaPath() || '';
161+
const condaEnvPath = condaEnvPathForCondaExePath(condaPath);
162+
let launchCommand = createCommandScriptInEnv(
163+
envPath,
164+
condaEnvPath,
165+
`jupyter lab --notebook-dir="${workingDir}"`
166+
);
167+
168+
launchTerminalInDirectory(envPath, launchCommand);
169+
}
170+
},
140171
{
141172
label: openInExplorerLabel,
142173
click: () => {

0 commit comments

Comments
 (0)