From e5a29771621e6518e7de4d7036b25d5efce727d5 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 19 Jan 2025 13:23:16 +0800 Subject: [PATCH] feat: update wget.ts --- script-meta-v2.json | 4 ++-- single-scripts/wget.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/script-meta-v2.json b/script-meta-v2.json index 1c50470..4e10cb4 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -40,8 +40,8 @@ }, "wget.ts": { "script_name": "wget.ts", - "script_length": 3567, - "script_sha256": "cb1d30254fd85a9db948f1f2de1d5b966d290677d40917a705e72a0385be97e3", + "script_length": 3789, + "script_sha256": "a5e72e6a86b2aa7a9f9fbe1e89e62100391b86ce11022e10e803c1816ace2f06", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/wget.ts", "single_script_file": true } diff --git a/single-scripts/wget.ts b/single-scripts/wget.ts index 78b8a4b..bce7820 100755 --- a/single-scripts/wget.ts +++ b/single-scripts/wget.ts @@ -126,4 +126,12 @@ if (contentLength !== null) { await response.body?.pipeTo(outputFileWritable); clearInterval(stateFileInterVal); await clearLastLine(); -console.log("Download finished."); + +const costTime = new Date().getTime() - startTime; +const fileInfo = await Deno.stat(outputFilename); +const fileSize = fileInfo.size; +console.log( + `Download finished, size: ${formatSize2(fileSize)}, time: ${ + formatHumanTime(costTime) + }`, +);