From 5ed38a488f1fcffecc3dbbb3f8c1da40cd5cf653 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Fri, 4 Sep 2026 15:57:33 +0800 Subject: [PATCH] chore: exclude macOS junk files from deploy tarball --- scripts/deploy.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 6b9d91b..6a19296 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -68,11 +68,14 @@ if [[ ! -d dist ]] || [[ -z "$(ls -A dist 2>/dev/null || true)" ]]; then fi echo "==> 同步 dist/ -> ${DEPLOY_HOST}:${DEPLOY_PATH}" -# macOS tar 可能带 Apple xattr;远端 GNU tar 会告警,不影响内容 -tar -C dist -czf - . \ +# 排除 macOS 垃圾文件;GNU tar 会忽略 Apple xattr 告警 +COPYFILE_DISABLE=1 tar -C dist -czf - \ + --exclude='.DS_Store' \ + --exclude='._*' \ + --exclude='.AppleDouble' \ + . \ | 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"