From cb9d68410d8d38a4136b1613ad321afac05056cc Mon Sep 17 00:00:00 2001 From: Justin Persaud Date: Fri, 11 Oct 2024 10:45:37 -0400 Subject: [PATCH 1/2] Automatically re-run patch-package if it fails --- scripts/applyPatches.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 4ce023755258..2e282a60b219 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -11,7 +11,7 @@ source "$SCRIPTS_DIR/shellUtils.sh" function patchPackage { OS="$(uname)" if [[ "$OS" == "Darwin" || "$OS" == "Linux" ]]; then - npx patch-package --error-on-fail --color=always + npx patch-package --error-on-fail --color=always || (echo 'Patch failed, reinstalling node_modules...' && npm ci && patch-package --error-on-fail --color=always) else error "Unsupported OS: $OS" exit 1 @@ -45,5 +45,4 @@ if [ "$EXIT_CODE" -eq 0 ]; then else # patch-package failed error "patch-package failed to apply a patch" - exit "$EXIT_CODE" fi From f73c87563e974e33820a00e5a3f3b99053954b03 Mon Sep 17 00:00:00 2001 From: Justin Persaud Date: Fri, 11 Oct 2024 10:49:19 -0400 Subject: [PATCH 2/2] put exit code back --- scripts/applyPatches.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/applyPatches.sh b/scripts/applyPatches.sh index 2e282a60b219..a93555fb992c 100755 --- a/scripts/applyPatches.sh +++ b/scripts/applyPatches.sh @@ -45,4 +45,5 @@ if [ "$EXIT_CODE" -eq 0 ]; then else # patch-package failed error "patch-package failed to apply a patch" + exit "$EXIT_CODE" fi