File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,12 @@ export async function downloadTool(
256
256
stream . on ( 'close' , ( ) => {
257
257
tl . debug ( 'download complete' ) ;
258
258
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
+
259
265
if ( ! isNaN ( downloadedContentLength ) &&
260
266
! isNaN ( fileSizeInBytes ) &&
261
267
fileSizeInBytes !== downloadedContentLength ) {
@@ -305,11 +311,9 @@ function _getFileSizeOnDisk(filePath: string): number {
305
311
try {
306
312
let fileStats = fs . statSync ( filePath ) ;
307
313
let fileSizeInBytes = fileStats . size ;
308
- tl . debug ( `Downloaded file size: ${ fileSizeInBytes } bytes` ) ;
309
314
return fileSizeInBytes ;
310
315
}
311
316
catch ( err ) {
312
- tl . debug ( `Unable to find file size for ${ filePath } ` ) ;
313
317
tl . warning ( `Unable to find file size for ${ filePath } due to error: ${ err . Message } ` ) ;
314
318
return NaN ;
315
319
}
You can’t perform that action at this time.
0 commit comments