Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add progress tracking to DirToUSSDirHandler for file upl… #2399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading