@@ -16,8 +16,7 @@ import { ConfigUtils } from "./ConfigUtils";
1616import { VscePromptApi } from "./VscePromptApi" ;
1717import { SshClientCache } from "./SshClientCache" ;
1818import { SshErrorHandler } from "./SshErrorHandler" ;
19- import { deployWithProgress } from "./ServerDeployment" ;
20- import path from "path/posix" ;
19+ import { deployWithProgress , isServerDetectedOnPath } from "./ServerDeployment" ;
2120
2221export function registerCommands ( context : vscode . ExtensionContext , zoweExplorerApi : IApiExplorerExtender ) : vscode . Disposable [ ] {
2322 const profCache = zoweExplorerApi . getProfilesCache ( ) ;
@@ -31,14 +30,7 @@ export function registerCommands(context: vscode.ExtensionContext, zoweExplorerA
3130 }
3231
3332 const sshSession = ZSshUtils . buildSession ( profile . profile ) ;
34- const pathServer = await ZSshUtils . detectServerOnPath ( sshSession ) ;
35- imperative . Logger . getAppLogger ( ) . trace ( "detectServerOnPath return value: %s" , JSON . stringify ( pathServer ) ) ;
36- if ( pathServer . serverPath
37- && pathServer . hasExecutePermission
38- && pathServer . writeAccessToParent ) {
39- imperative . Logger . getAppLogger ( ) . debug ( "Skipping deploy as an instance of the server exists on the user's PATH" ) ;
40- SshClientCache . inst . setOnPathServer ( profile , path . resolve ( pathServer . serverPath , '..' ) ) ;
41- } else {
33+ if ( ! ( await isServerDetectedOnPath ( sshSession , profile ) ) ) {
4234 const defaultServerPath = ConfigUtils . getServerPath ( profile . profile ) ;
4335 const deployDirectory = await vscePromptApi . promptForDeployDirectory ( profile . profile . host , defaultServerPath ) ;
4436 if ( ! deployDirectory ) {
@@ -55,7 +47,6 @@ export function registerCommands(context: vscode.ExtensionContext, zoweExplorerA
5547 }
5648
5749 await ConfigUtils . showSessionInTree ( profile . name ! , true , zoweExplorerApi ) ;
58-
5950 } ) ,
6051 vscode . commands . registerCommand ( `zowe.zowex.restart` , async ( profName ?: string ) => {
6152 imperative . Logger . getAppLogger ( ) . trace ( "Running restart command for profile %s" , profName ) ;
0 commit comments