Skip to content

Commit

Permalink
Enhancement: Add progress tracking to DirToUSSDirHandler for file upl…
Browse files Browse the repository at this point in the history
…oads

Signed-off-by: MAVRICK-1 <[email protected]>
  • Loading branch information
MAVRICK-1 committed Dec 27, 2024
1 parent f94ed83 commit 972a215
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,19 @@ export default class DirToUSSDirHandler extends ZosFilesBaseHandler {
uploadOptions.filesMap = this.buildFilesMap(commandParameters);
}

const uploadApi = commandParameters.arguments.recursive ? Upload.dirToUSSDirRecursive : Upload.dirToUSSDir;
const response = await uploadApi.bind(Upload)(session, inputDir, commandParameters.arguments.USSDir, uploadOptions);
commandParameters.response.progress.startBar("Uploading files...");

const formatMessage = TextUtils.prettyJson(response.apiResponse);
commandParameters.response.console.log(formatMessage);
return response;
try {
const uploadApi = commandParameters.arguments.recursive ? Upload.dirToUSSDirRecursive : Upload.dirToUSSDir;
const response = await uploadApi.bind(Upload)(session, inputDir, commandParameters.arguments.USSDir, uploadOptions);

const formatMessage = TextUtils.prettyJson(response.apiResponse);
commandParameters.response.console.log(formatMessage);

return response;
} finally {
commandParameters.response.progress.endBar();
}
}

private buildFilesMap(commandParameters: IHandlerParameters) {
Expand Down
4 changes: 4 additions & 0 deletions packages/imperative/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the Imperative package will be documented in this file.

## Recent Changes

- Enhancement: Added progress tracking to the `DirToUSSDirHandler` by using `commandParameters.response.progress` to show progress bars during file uploads. [#2334](https://github.com/zowe/zowe-cli/issues/2344)


## `8.10.1`

Expand Down

0 comments on commit 972a215

Please sign in to comment.