Skip to content

Commit

Permalink
fixed #39, run docker rm container in shell env
Browse files Browse the repository at this point in the history
  • Loading branch information
iishiishii committed Oct 20, 2024
1 parent d367e3d commit 6d6cfd6
Showing 1 changed file with 16 additions and 63 deletions.
79 changes: 16 additions & 63 deletions src/main/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,47 +276,6 @@ export class JupyterServer {
baseCondaPath = await this._registry.condaRootPath;
}

// if (!baseCondaPath) {
// const choice = dialog.showMessageBoxSync({
// message: 'Select conda base environment',
// detail:
// 'Base conda environment not found. Please select a root conda environment to activate the custom environment.',
// type: 'error',
// buttons: ['OK', 'Cancel'],
// defaultId: 0,
// cancelId: 1
// });
// if (choice == 1) {
// reject('Failed to activate conda environment');
// return;
// }

// const filePaths = dialog.showOpenDialogSync({
// properties: [
// 'openDirectory',
// 'showHiddenFiles',
// 'noResolveAliases'
// ],
// buttonLabel: 'Use Conda Root'
// });

// if (filePaths && filePaths.length > 0) {
// baseCondaPath = filePaths[0];
// if (
// !this._registry.validateCondaBaseEnvironmentAtPath(
// baseCondaPath
// )
// ) {
// reject('Invalid base conda environment');
// return;
// }
// this._registry.setCondaRootPath(baseCondaPath);
// } else {
// reject('Failed to activate conda environment');
// return;
// }
// }
// }
console.log('token', this._info.token);
const launchScriptPath = createLaunchScript(
this._info,
Expand Down Expand Up @@ -418,7 +377,6 @@ export class JupyterServer {

this._nbServer.on('exit', (code, signal) => {
const _code: number | null = code;
'child process exited with ' + `code ${code} and signal ${signal}`;
stdoutChunks.concat(
'child process exited with ' +
`code ${code} and signal ${signal} on this._restartCount ${this._restartCount}`
Expand Down Expand Up @@ -481,30 +439,25 @@ export class JupyterServer {
this._stopServer = new Promise<void>((resolve, reject) => {
if (this._nbServer !== undefined) {
if (process.platform === 'win32') {
execFile('taskkill', [
'/PID',
String(this._nbServer.pid),
'/T',
'/F'
]);
execFile(`${engineCmd} stop neurodeskapp-${this._info.port}`, () => {
this._shutdownServer()
.then(() => {
this._stopping = false;
resolve();
})
.catch(reject);
execFile(`${engineCmd} rm -f neurodeskapp-${this._info.port}`, {
shell: 'cmd.exe'
});
this._shutdownServer()
.then(() => {
this._stopping = false;
resolve();
})
.catch(reject);
} else {
this._nbServer.kill();
execFile(`${engineCmd} stop neurodeskapp-${this._info.port}`, () => {
this._shutdownServer()
.then(() => {
this._stopping = false;
resolve();
})
.catch(reject);
execFile(`${engineCmd} rm -f neurodeskapp-${this._info.port}`, {
shell: '/bin/bash'
});
this._shutdownServer()
.then(() => {
this._stopping = false;
resolve();
})
.catch(reject);
}
} else {
this._stopping = false;
Expand Down

0 comments on commit 6d6cfd6

Please sign in to comment.