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"