From 5813346f735d300f97befd5410be50aa13dc4538 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Mon, 9 Feb 2026 00:59:35 +0800 Subject: [PATCH] update build.ts --- script-meta-v2.json | 6 +++--- single-scripts/build.ts | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/script-meta-v2.json b/script-meta-v2.json index 5963b4a..552bcf7 100644 --- a/script-meta-v2.json +++ b/script-meta-v2.json @@ -18,12 +18,12 @@ }, "build.ts": { "script_name": "build.ts", - "script_length": 4878, - "script_sha256": "d7df641b6e4fe1e3618d951c50303b4ca2c83d7ec3a8d30a25d1555562c0d71d", + "script_length": 5021, + "script_sha256": "0360ac3b4be39b9a9d1c41504dda460606603513320832689aba36fa726e3bbf", "script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/build.ts", "single_script_file": true, "publish_time": 1770564482429, - "update_time": 1770569587837 + "update_time": 1770569970701 }, "cal-bun.ts": { "script_name": "cal-bun.ts", diff --git a/single-scripts/build.ts b/single-scripts/build.ts index 5f1f15c..d83ba3b 100755 --- a/single-scripts/build.ts +++ b/single-scripts/build.ts @@ -42,11 +42,15 @@ async function main() { } flags.min = !flags["no-min"]; - const filesCount = flags._.length; + const files: string[] = flags._.filter((f) => { + return f.endsWith(".ts") && !f.includes(".bundle."); + }); + + const filesCount = files.length; log.info(`Total ${filesCount} file(s)`); for (let i = 0; i < filesCount; i++) { - const file = flags._[i]; - if (file.includes(".bundle.")) { + const file = files[i]; + if (file.includes(".bundle.") || !file.endsWith(".ts")) { log.warn(`Skip bundle file: ${file} #${i + 1} of ${filesCount}`); continue; } @@ -160,5 +164,5 @@ async function buildFile(file: string, flags: any) { await main(); -// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260209T005219+08:00.MEUCIDo3pPzkGK7FiGyuEOOr -// evz4jRLWSy5vuqZ1FynulxpkAiEAhGVuwgCzBTzwPSpV4r8aEQFJ6sjd/pZrRq3eUoG9DbE= +// @SCRIPT-SIGNATURE-V1: yk-r1.ES256.20260209T005851+08:00.MEQCIDd33gREmm1CEKO83ZBC +// B3iYNDB5hcaPuiUyH5TGR7VBAiBsxkw+GcD0fPpxTj2Yi43VFx/6YAT8L5HA7p9VEZwxdA==