@@ -81,9 +81,10 @@ export namespace DeployTools {
8181 * @param workspaceIndex if no index is provided, a prompt will be shown to pick one if there are multiple workspaces,
8282 * otherwise the current workspace will be used.
8383 * @param method if no method is provided, a prompt will be shown to pick the deployment method.
84+ * @param selectedFiles if the "selected" deployment method is used, these files will be deployed.
8485 * @returns the index of the deployed workspace or `undefined` if the deployment failed
8586 */
86- export async function launchDeploy ( workspaceIndex ?: number , method ?: DeploymentMethod ) : Promise < { remoteDirectory : string , workspaceId : number } | undefined > {
87+ export async function launchDeploy ( workspaceIndex ?: number , method ?: DeploymentMethod , selectedFiles ?: Uri [ ] ) : Promise < { remoteDirectory : string , workspaceId : number } | undefined > {
8788 const folder = await Deployment . getWorkspaceFolder ( workspaceIndex ) ;
8889 if ( folder ) {
8990 const remotePath = getRemoteDeployDirectory ( folder ) ;
@@ -127,7 +128,8 @@ export namespace DeployTools {
127128 const parameters : DeploymentParameters = {
128129 workspaceFolder : folder ,
129130 remotePath,
130- method
131+ method,
132+ selectedFiles
131133 } ;
132134
133135 if ( await deploy ( parameters ) ) {
@@ -140,7 +142,7 @@ export namespace DeployTools {
140142 }
141143 } else {
142144 if ( await vscode . window . showErrorMessage ( `Chosen location (${ folder . uri . fsPath } ) is not configured for deployment.` , 'Set deploy location' ) ) {
143- setDeployLocation ( undefined , folder , buildPossibleDeploymentDirectory ( folder ) ) ;
145+ setDeployLocation ( undefined , folder , buildPossibleDeploymentDirectory ( folder ) , method , selectedFiles ) ;
144146 }
145147 }
146148 }
@@ -187,6 +189,10 @@ export namespace DeployTools {
187189 deletes . push ( ...relativeRemoteDeletes ) ;
188190 break ;
189191
192+ case "selected" :
193+ files . push ( ...parameters . selectedFiles || [ ] ) ;
194+ break ;
195+
190196 case "all" :
191197 files . push ( ...await getDeployAllFiles ( parameters ) ) ;
192198 break ;
@@ -333,7 +339,7 @@ export namespace DeployTools {
333339 return ( await Deployment . findFiles ( parameters , "**/*" , "**/.git*" ) ) ;
334340 }
335341
336- export async function setDeployLocation ( node : any , workspaceFolder ?: WorkspaceFolder , value ?: string ) {
342+ export async function setDeployLocation ( node : any , workspaceFolder ?: WorkspaceFolder , value ?: string , method ?: DeploymentMethod , selectedFiles ?: Uri [ ] ) {
337343 const path = node ?. path || await vscode . window . showInputBox ( {
338344 prompt : `Enter IFS directory to deploy to` ,
339345 value
@@ -353,7 +359,7 @@ export namespace DeployTools {
353359 instance . fire ( `deployLocation` ) ;
354360
355361 if ( await vscode . window . showInformationMessage ( `Deployment location set to ${ path } ` , `Deploy now` ) ) {
356- vscode . commands . executeCommand ( `code-for-ibmi.launchDeploy` , chosenWorkspaceFolder . index ) ;
362+ vscode . commands . executeCommand ( `code-for-ibmi.launchDeploy` , chosenWorkspaceFolder . index , method , selectedFiles ) ;
357363 }
358364 }
359365 }
0 commit comments