From b98d1bf9d3b8f6ebb01724fe5af357d2a0c43470 Mon Sep 17 00:00:00 2001 From: Bohan Zhang <32930283+AngelPone@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:15:13 +1100 Subject: [PATCH] fix(cli): uploadCounters increase only when files are uploaded (#6357) * uploadcounters increase only when files are uploaded * move up totalSizeUploaded counter --- cli/src/commands/upload.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/src/commands/upload.ts b/cli/src/commands/upload.ts index 796ae4923e..e647d38153 100644 --- a/cli/src/commands/upload.ts +++ b/cli/src/commands/upload.ts @@ -107,6 +107,8 @@ export class Upload extends BaseCommand { const formData = asset.getUploadFormData(); const res = await this.uploadAsset(formData); existingAssetId = res.data.id; + uploadCounter++; + totalSizeUploaded += asset.fileSize; } if ((options.album || options.albumName) && asset.albumName !== undefined) { @@ -127,9 +129,6 @@ export class Upload extends BaseCommand { } } } - - totalSizeUploaded += asset.fileSize; - uploadCounter++; } sizeSoFar += asset.fileSize;