From 13ce654ac2b205eb98553775846346f0b7a7ce18 Mon Sep 17 00:00:00 2001 From: jim800121chen Date: Sun, 12 Apr 2026 02:17:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(local-tool):=20ffmpeg=20zip=20=E4=B8=8B?= =?UTF-8?q?=E8=BC=89=E6=94=B9=E7=94=A8=E7=9B=B8=E5=B0=8D=E8=B7=AF=E5=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows 版 python.exe 不懂 MSYS2 的 /tmp 路徑語法,會拿著字面值 '/tmp/...' 去 Windows filesystem 找不到檔案。改下載到 vendor/ffmpeg/windows/ffmpeg-win.zip 相對路徑,bash 跟 python 都看得懂。 Co-Authored-By: Claude Opus 4.6 (1M context) --- local-tool/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/local-tool/Makefile b/local-tool/Makefile index b1cfa78..984894a 100644 --- a/local-tool/Makefile +++ b/local-tool/Makefile @@ -264,7 +264,7 @@ vendor-ffmpeg-windows: ## 下載 ffmpeg Windows static build → vendor/ffmpeg/w else \ echo "==> 下載 ffmpeg Windows build from BtbN..."; \ echo "!! WARNING: BtbN 為 GPL build;license 由 PM 最終確認 !!"; \ - curl -fL -o /tmp/ffmpeg-win.zip "$(FFMPEG_URL_WINDOWS)"; \ + curl -fL -o vendor/ffmpeg/windows/ffmpeg-win.zip "$(FFMPEG_URL_WINDOWS)"; \ PY=""; \ for candidate in "$$VISIONA_PYTHON" "py -3" python3 python; do \ [ -z "$$candidate" ] && continue; \ @@ -274,12 +274,12 @@ vendor-ffmpeg-windows: ## 下載 ffmpeg Windows static build → vendor/ffmpeg/w done; \ if [ -z "$$PY" ]; then echo "ERROR: 需要真實 python 來解壓 zip(WindowsApps stub 無法使用)"; exit 1; fi; \ echo "==> 使用 $$PY 解壓 ffmpeg zip"; \ - $$PY -c "import zipfile, shutil; z=zipfile.ZipFile('/tmp/ffmpeg-win.zip'); \ + $$PY -c "import zipfile, shutil; z=zipfile.ZipFile('vendor/ffmpeg/windows/ffmpeg-win.zip'); \ members=[n for n in z.namelist() if n.endswith('/bin/ffmpeg.exe')]; \ assert members, 'ffmpeg.exe not found in zip'; \ src=z.open(members[0]); dst=open('vendor/ffmpeg/windows/ffmpeg.exe','wb'); \ shutil.copyfileobj(src, dst); src.close(); dst.close(); z.close()" || { echo "ERROR: python 解壓失敗"; exit 1; }; \ - rm -f /tmp/ffmpeg-win.zip; \ + rm -f vendor/ffmpeg/windows/ffmpeg-win.zip; \ [ -f vendor/ffmpeg/windows/ffmpeg.exe ] || { echo "ERROR: ffmpeg.exe 沒被寫出"; exit 1; }; \ echo "==> ffmpeg.exe 大小:$$(du -sh vendor/ffmpeg/windows/ffmpeg.exe | cut -f1)"; \ fi