From 2ff51f00ca8814fe30c4d587e07020b07117dd23 Mon Sep 17 00:00:00 2001 From: uncle6me-web Date: Wed, 10 Jun 2026 16:46:58 +0800 Subject: [PATCH] =?UTF-8?q?chore(cli):=20acr=20update=20=E4=B8=8B=E8=BC=89?= =?UTF-8?q?/=E8=A7=A3=E5=A3=93=E9=80=B2=E5=BA=A6=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=88chalk=20gray=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.8 --- cli/src/lib/deploy.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/src/lib/deploy.ts b/cli/src/lib/deploy.ts index 4037e01..94472c5 100644 --- a/cli/src/lib/deploy.ts +++ b/cli/src/lib/deploy.ts @@ -12,6 +12,7 @@ import { execFileSync } from 'node:child_process'; import { mkdtempSync, readFileSync, writeFileSync, existsSync, readdirSync, statSync } from 'node:fs'; import { tmpdir } from 'node:os'; import { join } from 'node:path'; +import chalk from 'chalk'; /** GitHub repo(codeload tarball 來源)。fork 者改這裡或用 ARCRUN_REPO env。 * 注意:repo 名大小寫敏感(codeload 路徑需完全一致)。*/ @@ -185,10 +186,13 @@ async function applyD1Migration(ctx: DeployContext, sql: string): Promise /** 下載 codeload tarball 解壓到暫存目錄,回傳解壓出的 repo root 路徑。*/ async function downloadRepoTarball(ref: string): Promise { const url = `https://codeload.github.com/${ARCRUN_REPO}/tar.gz/${ref}`; + console.log(chalk.gray(` → 從 GitHub 下載最新版本(${ARCRUN_REPO}@${ref},約 10–30 秒,視網速)...`)); const res = await fetch(url, { signal: AbortSignal.timeout(120_000) }); if (!res.ok) throw new Error(`codeload HTTP ${res.status}(${url})`); const buf = Buffer.from(await res.arrayBuffer()); + const sizeMB = (buf.length / 1024 / 1024).toFixed(1); + console.log(chalk.gray(` → 下載完成(${sizeMB} MB),解壓中...`)); const dir = mkdtempSync(join(tmpdir(), 'arcrun-deploy-')); const tarPath = join(dir, 'repo.tar.gz'); writeFileSync(tarPath, buf);