Files
httptoolkit/scripts/patch.sh
T
2026-08-15 03:15:19 +05:00

30 lines
915 B
Bash
Executable File

#!/usr/bin/env bash
#
# Apply our patches + overlay onto the cloned upstream repos.
# Fails loudly if a patch no longer applies (upstream moved).
#
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
apply_patches() {
local name="$1" dir="$2"
[ -d "patches/$name" ] || return 0
echo "==> [$name] applying patches"
for patch in patches/"$name"/*.patch; do
[ -e "$patch" ] || continue
echo " - $(basename "$patch")"
git -C "$dir" apply --3way "$ROOT/$patch"
done
}
apply_patches ui httptoolkit-ui
apply_patches server httptoolkit-server
echo "==> Copying overlay into httptoolkit-server"
cp -v overlay/server/htk-entry.ts httptoolkit-server/htk-entry.ts
cp -v overlay/server/src/htk-app.ts httptoolkit-server/src/htk-app.ts
cp -v overlay/server/src/commands/app.ts httptoolkit-server/src/commands/app.ts
echo "==> patch.sh complete."