package.sh 679 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. set -euo pipefail
  3. repo_root="$(cd "$(dirname "$0")/../.." && pwd)"
  4. publish_dir="$repo_root/dist/legacy-sync-bridge-win-x64"
  5. output="$repo_root/dist/xiaoshu-legacy-sync-bridge-iis.zip"
  6. stage="$(mktemp -d)"
  7. trap 'rm -rf "$stage"' EXIT
  8. test -f "$publish_dir/Xiaoshu.LegacySyncBridge.dll"
  9. cp -R "$publish_dir/." "$stage/"
  10. cp -R "$repo_root/legacy-sync-bridge/database" "$stage/database"
  11. rm -rf "$stage/deployment"
  12. cp -R "$repo_root/legacy-sync-bridge/deployment" "$stage/deployment"
  13. cp "$repo_root/legacy-sync-bridge/README.md" "$stage/README.md"
  14. rm -f "$stage/deployment/package.sh"
  15. rm -f "$output"
  16. (cd "$stage" && zip -qr "$output" .)
  17. printf '%s\n' "$output"