1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-28 21:25:25 +00:00
code-server-2/test/scripts/patch.sh
2021-02-26 16:00:18 -07:00

27 lines
835 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
apply_service_worker_mock_patches() {
# The `service-worker-mock` package is no longer maintained
# so we have to apply patches ourselves
# This patch fixes an undefined error in fetch.js and adds a missing import
patch --forward node_modules/service-worker-mock/fetch.js < patches/service-worker-mock-fetch.patch
# This patch adds a missing import
patch --forward node_modules/service-worker-mock/models/Response.js < patches/service-worker-mock-response.patch
# This patch fixes the types declaration file
# See discussion:
patch --forward node_modules/@types/service-worker-mock/index.d.ts < patches/service-worker-types.patch
}
main() {
echo -e "🔨 Applying patches..."
apply_service_worker_mock_patches
echo -e "✅ Patches applied successfully."
}
main "$@"