Skip to content

Commit

Permalink
resolve working directory from serverArgs
Browse files Browse the repository at this point in the history
  • Loading branch information
iishiishii committed Oct 31, 2024
1 parent 1a205af commit b2e3e7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/main/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
import {
EngineType,
KeyValueMap,
resolveWorkingDirectory,
serverLaunchArgsDefault,
serverLaunchArgsFixed,
SettingType,
Expand Down Expand Up @@ -81,7 +82,7 @@ function createLaunchScript(
}`;
let volumeCreate = `${isPodman ? `${volumeCheck}` : ''}`;

let machineCmd = '';
// let machineCmd = '';
// if (isPodman && process.platform == 'darwin') {
// machineCmd = `podman machine reset -f && podman machine init --rootful --now -v /Volumes:/Volumes -v $HOME:$HOME podman-machine-default`;
// }
Expand All @@ -105,8 +106,9 @@ function createLaunchScript(
const config = Config.loadConfig(path.join(__dirname, '..'));
const tag = config.ConfigToml.jupyter_neurodesk_version;

if (serverInfo.workingDirectory) {
launchArgs.push(` --volume ${serverInfo.workingDirectory}:/data`);
if (serverInfo.serverArgs) {
let additionalDir = resolveWorkingDirectory(serverInfo.serverArgs);
launchArgs.push(` --volume ${additionalDir}:/data`);
}

for (const arg of serverLaunchArgsFixed) {
Expand Down Expand Up @@ -158,8 +160,7 @@ function createLaunchScript(
${volumeCreate}
${launchCmd}
else
${stopCmd}
${machineCmd}
${stopCmd}
${volumeCreate}
${engineCmd} pull docker.io/vnmd/neurodesktop:${tag}
${launchCmd}
Expand Down Expand Up @@ -475,6 +476,7 @@ export class JupyterServer {
// }
// );
// }
this._nbServer.kill();
this._shutdownServer()
.then(() => {
this._stopping = false;
Expand Down
2 changes: 1 addition & 1 deletion src/main/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,5 @@ export function customRelaunch(): void {
stdio: 'ignore'
});
// Exit the parent process
process.exit();
// process.exit();
}

0 comments on commit b2e3e7d

Please sign in to comment.