@@ -311,10 +311,22 @@ export class GkCliIntegrationProvider implements Disposable {
311311 let cliInstallStatus = cliInstall ?. status ?? 'attempted' ;
312312 let cliVersion = cliInstall ?. version ;
313313 let cliPath = this . container . storage . get ( 'gk:cli:path' ) ;
314+ const platform = getPlatform ( ) ;
314315
315316 if ( cliInstallStatus === 'completed' ) {
316- cliVersion = cliInstall ?. version ;
317- return { cliVersion : cliVersion , cliPath : cliPath , status : 'completed' } ;
317+ if ( cliPath == null ) {
318+ cliInstallStatus = 'attempted' ;
319+ cliVersion = undefined ;
320+ } else {
321+ cliVersion = cliInstall ?. version ;
322+ try {
323+ await workspace . fs . stat ( Uri . joinPath ( Uri . file ( cliPath ) , platform === 'windows' ? 'gk.exe' : 'gk' ) ) ;
324+ return { cliVersion : cliVersion , cliPath : cliPath , status : 'completed' } ;
325+ } catch {
326+ cliInstallStatus = 'attempted' ;
327+ cliVersion = undefined ;
328+ }
329+ }
318330 } else if ( cliInstallStatus === 'unsupported' ) {
319331 return { cliVersion : undefined , cliPath : undefined , status : 'unsupported' } ;
320332 } else if ( autoInstall && cliInstallStatus === 'attempted' && cliInstallAttempts >= 5 ) {
@@ -348,9 +360,6 @@ export class GkCliIntegrationProvider implements Disposable {
348360 throw new CLIInstallError ( CLIInstallErrorReason . UnsupportedPlatform , undefined , 'web' ) ;
349361 }
350362
351- // Detect platform and architecture
352- const platform = getPlatform ( ) ;
353-
354363 // Map platform names for the API and get architecture
355364 let platformName : string ;
356365 let architecture : string ;
0 commit comments