Browse Source

chore: exclude macOS junk files from deploy tarball

main
xiaosi 2 weeks ago
parent
commit
5ed38a488f
  1. 9
      scripts/deploy.sh

9
scripts/deploy.sh

@ -68,11 +68,14 @@ if [[ ! -d dist ]] || [[ -z "$(ls -A dist 2>/dev/null || true)" ]]; then
fi fi
echo "==> 同步 dist/ -> ${DEPLOY_HOST}:${DEPLOY_PATH}" 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" \ | ssh -o BatchMode=yes "$DEPLOY_HOST" \
"mkdir -p '$DEPLOY_PATH' && rm -rf '$DEPLOY_PATH'/* && tar -C '$DEPLOY_PATH' -xzf -" "mkdir -p '$DEPLOY_PATH' && rm -rf '$DEPLOY_PATH'/* && tar -C '$DEPLOY_PATH' -xzf -"
echo "==> 校验远端文件" echo "==> 校验远端文件"
ssh -o BatchMode=yes "$DEPLOY_HOST" \ ssh -o BatchMode=yes "$DEPLOY_HOST" \
"test -f '$DEPLOY_PATH/index.html' && ls -lah '$DEPLOY_PATH' | head -20" "test -f '$DEPLOY_PATH/index.html' && ls -lah '$DEPLOY_PATH' | head -20"

Loading…
Cancel
Save