Skip to content

Commit bb79639

Browse files
msivasubramaniaandatho7561
authored andcommitted
added platform check for getting the tool name
Signed-off-by: msivasubramaniaan <[email protected]>
1 parent e3b21b6 commit bb79639

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/webview/openshift-terminal/openShiftTerminal.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { CliChannel } from '../../cli';
2424
import { ToolsConfig } from '../../tools';
2525
import { getVscodeModule } from '../../util/credentialManager';
2626
import { loadWebviewHtml } from '../common-ext/utils';
27+
import { Platform } from '../../util/platform';
2728

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

0 commit comments

Comments
 (0)