Skip to content

Commit

Permalink
added platform check for getting the tool name
Browse files Browse the repository at this point in the history
Signed-off-by: msivasubramaniaan <msivasub@redhat.com>
  • Loading branch information
msivasubramaniaan authored and datho7561 committed Jan 31, 2024
1 parent e3b21b6 commit bb79639
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/webview/openshift-terminal/openShiftTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { CliChannel } from '../../cli';
import { ToolsConfig } from '../../tools';
import { getVscodeModule } from '../../util/credentialManager';
import { loadWebviewHtml } from '../common-ext/utils';
import { Platform } from '../../util/platform';

// HACK: we cannot include node-pty ourselves,
// since the library can only be run under one version of node
Expand Down Expand Up @@ -485,7 +486,11 @@ export class OpenShiftTerminalManager implements WebviewViewProvider {
} else if (message.kind === 'resize') {
terminal.resize(message.data.cols, message.data.rows);
} else if (message.kind === 'closeTerminal') {
if (terminal.file.endsWith('func.exe')) {
let serverlessFuncTool = 'func';
if (Platform.OS === 'win32') {
serverlessFuncTool = serverlessFuncTool.concat('.exe');
}
if (terminal.file.endsWith(serverlessFuncTool)) {
void commands.executeCommand('openshift.Serverless.removeSession' , terminal.uuid, terminal.cwd, terminal.name);
}
terminal.dispose();
Expand Down

0 comments on commit bb79639

Please sign in to comment.