Skip to content

Commit

Permalink
Automatically re-run patch-package if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpersaud committed Oct 11, 2024
1 parent abdfb72 commit cb9d684
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions scripts/applyPatches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit cb9d684

Please sign in to comment.