From 2a10f422e1fbbdac1b2d70461b5054480b09c7c0 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Fri, 4 Sep 2026 15:57:56 +0800 Subject: [PATCH] chore: purge macOS junk from dist before deploy --- scripts/deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 6a19296..c70f3bb 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -67,8 +67,11 @@ if [[ ! -d dist ]] || [[ -z "$(ls -A dist 2>/dev/null || true)" ]]; then exit 1 fi +# 清理本地 dist 里的 macOS 垃圾,避免打进包 +find dist \( -name '.DS_Store' -o -name '._*' -o -name '.AppleDouble' \) -delete 2>/dev/null || true + echo "==> 同步 dist/ -> ${DEPLOY_HOST}:${DEPLOY_PATH}" -# 排除 macOS 垃圾文件;GNU tar 会忽略 Apple xattr 告警 +# COPYFILE_DISABLE 避免 macOS 再生成 AppleDouble;远端 xattr 告警可忽略 COPYFILE_DISABLE=1 tar -C dist -czf - \ --exclude='.DS_Store' \ --exclude='._*' \ @@ -76,6 +79,7 @@ COPYFILE_DISABLE=1 tar -C dist -czf - \ . \ | ssh -o BatchMode=yes "$DEPLOY_HOST" \ "mkdir -p '$DEPLOY_PATH' && rm -rf '$DEPLOY_PATH'/* && tar -C '$DEPLOY_PATH' -xzf -" + echo "==> 校验远端文件" ssh -o BatchMode=yes "$DEPLOY_HOST" \ "test -f '$DEPLOY_PATH/index.html' && ls -lah '$DEPLOY_PATH' | head -20"