DEV: Automatically retry patch-package on failure (#23583)
We are seeing occasional flakes in `patch-package`, possibly caused by https://github.com/ds300/patch-package/issues/484. This wrapper script will retry patch-package three times before giving up. Longer-term we hope to upgrade to a package manager with built-in patch support.
This commit is contained in:
parent
4571197e06
commit
45adb22abe
|
@ -13,7 +13,7 @@
|
|||
"build": "ember build",
|
||||
"start": "ember serve",
|
||||
"test": "ember test",
|
||||
"postinstall": "yarn --silent --cwd .. patch-package"
|
||||
"postinstall": "../run-patch-package"
|
||||
},
|
||||
"dependencies": {
|
||||
"@glimmer/syntax": "^0.84.3",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"postinstall": "patch-package"
|
||||
"postinstall": "./run-patch-package"
|
||||
},
|
||||
"workspaces": [
|
||||
"admin",
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
# We are seeing occasional flakes in `patch-package`, possibly caused by https://github.com/ds300/patch-package/issues/484
|
||||
# This script will retry it three times before giving up.
|
||||
# Longer-term we hope to upgrade to a package manager with built-in patch support.
|
||||
|
||||
for i in {1..3}; do
|
||||
if [ $i -ne 1 ]; then
|
||||
echo "patch-package failed... retry ($i/3)..."
|
||||
fi
|
||||
|
||||
script_dir=$(dirname "$0")
|
||||
yarn --silent --cwd "${script_dir}" patch-package && exit 0;
|
||||
done
|
||||
|
||||
exit 1;
|
Loading…
Reference in New Issue