Skip to content

Commit 9efcd13

Browse files
add findstr when windows machine (#3715)
Signed-off-by: msivasubramaniaan <[email protected]>
1 parent 3d60d1e commit 9efcd13

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/oc/ocWrapper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import * as tmp from 'tmp';
99
import { CommandOption, CommandText } from '../base/command';
1010
import { CliChannel } from '../cli';
1111
import { ClusterType, KubernetesConsole } from './types';
12+
import { Platform } from '../util/platform';
1213

1314
/**
1415
* A wrapper around the `oc` CLI tool.
@@ -376,8 +377,9 @@ export class Oc {
376377
* @returns true if the current cluster is an OpenShift cluster, and false otherwise
377378
*/
378379
public async isOpenShiftCluster(): Promise<boolean> {
380+
const find = Platform.OS !== 'win32' ? 'grep' : 'FINDSTR';
379381
try {
380-
const result = await CliChannel.getInstance().executeTool(new CommandText('oc api-resources | grep openshift'));
382+
const result = await CliChannel.getInstance().executeTool(new CommandText(`oc api-resources | ${find} openshift`));
381383
if (result.stdout.length === 0) {
382384
return false;
383385
}

0 commit comments

Comments
 (0)