Skip to content

Commit

Permalink
Merge pull request #2399 from MAVRICK-1/feature/add-progress-bar-to-d…
Browse files Browse the repository at this point in the history
…ir-upload

Enhancement: Add progress tracking to DirToUSSDirHandler for file upl…
  • Loading branch information
t1m0thyj authored Jan 7, 2025
2 parents 7ac5ab7 + 9145334 commit bf77e64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to the Zowe CLI package will be documented in this file.

## Recent Changes

- BugFix: Fixed an issue where the `zowe files upload dir-to-uss` command was missing progress bar to track progress of file uploads. [#2344](https://github.com/zowe/zowe-cli/issues/2344)

## `8.10.3`

- BugFix: The `zowe files copy data-set` command no longer copies all partitioned data set members if a member is specified. [#2402](https://github.com/zowe/zowe-cli/pull/2402)
Expand Down
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({ task: status });

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

0 comments on commit bf77e64

Please sign in to comment.