diff --git a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts index f5c406ac37..2f37a11abf 100644 --- a/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts +++ b/packages/cli/src/zosfiles/upload/dtu/DirToUSSDir.handler.ts @@ -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) { diff --git a/packages/imperative/CHANGELOG.md b/packages/imperative/CHANGELOG.md index 0ba57c37bf..536b05870e 100644 --- a/packages/imperative/CHANGELOG.md +++ b/packages/imperative/CHANGELOG.md @@ -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`