File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import * as tmp from 'tmp';
99import { CommandOption , CommandText } from '../base/command' ;
1010import { CliChannel } from '../cli' ;
1111import { 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 }
You can’t perform that action at this time.
0 commit comments