#!/usr/bin/env bash # Warm every pin (including transitive sources and binary artifact archives) # before a cut. Safe to repeat; already-cached pins never update their remotes. # Usage: bash scripts/warm-swiftpm-cache.sh [package-directory] set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" APP="${1:-$HERE/../apps/cotton}" APP="$(cd "$APP" && pwd)" . "$HERE/lib/swiftpm-cache.sh" cotton_retain_swiftpm_cache if [ "$APP" = "$(cd "$HERE/../apps/cotton" && pwd)" ]; then bash "$HERE/ffi-stub.sh" fi swift package --package-path "$APP" --cache-path "$(cotton_swiftpm_cache)" \ --scratch-path "$(cotton_swiftpm_cache)/resolved/$(cotton_swiftpm_key "$APP")" \ --skip-update --force-resolved-versions resolve