Skip to content

Commit 145a81a

Browse files
author
Tatyana Kostromskaya (Akvelon)
committed
Fix comment
1 parent b56f93b commit 145a81a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tool.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ export async function downloadTool(
256256
stream.on('close', () => {
257257
tl.debug('download complete');
258258
let fileSizeInBytes = _getFileSizeOnDisk(destPath);
259+
if (!isNaN(fileSizeInBytes)) {
260+
tl.debug(`Downloaded file size: ${fileSizeInBytes} bytes`);
261+
} else {
262+
tl.debug(`File size on disk was not found`);
263+
}
264+
259265
if (!isNaN(downloadedContentLength) &&
260266
!isNaN(fileSizeInBytes) &&
261267
fileSizeInBytes !== downloadedContentLength) {
@@ -305,11 +311,9 @@ function _getFileSizeOnDisk(filePath: string): number {
305311
try {
306312
let fileStats = fs.statSync(filePath);
307313
let fileSizeInBytes = fileStats.size;
308-
tl.debug(`Downloaded file size: ${fileSizeInBytes} bytes`);
309314
return fileSizeInBytes;
310315
}
311316
catch (err) {
312-
tl.debug(`Unable to find file size for ${filePath}`);
313317
tl.warning(`Unable to find file size for ${filePath} due to error: ${err.Message}`);
314318
return NaN;
315319
}

0 commit comments

Comments
 (0)