Skip to content

Commit

Permalink
add menu item to launch web app from environment menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mbektas committed Mar 24, 2024
1 parent e3b9059 commit a21398d
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/main/pythonenvdialog/pythonenvdialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,37 @@ export class ManagePythonEnvironmentDialog {
launchTerminalInDirectory(envPath, activateCommand);
}
},
{
label: 'Launch JupyterLab Web App',
click: async () => {
const { filePaths } = await dialog.showOpenDialog({
title: 'Choose working directory',
properties: [
'showHiddenFiles',
'noResolveAliases',
'openDirectory',
'createDirectory'
],
buttonLabel: 'Launch'
});

if (filePaths.length === 0) {
return;
}

const workingDir = filePaths[0];

const condaPath = getCondaPath() || '';
const condaEnvPath = condaEnvPathForCondaExePath(condaPath);
let launchCommand = createCommandScriptInEnv(
envPath,
condaEnvPath,
`jupyter lab --notebook-dir="${workingDir}"`
);

launchTerminalInDirectory(envPath, launchCommand);
}
},
{
label: openInExplorerLabel,
click: () => {
Expand Down

0 comments on commit a21398d

Please sign in to comment.