Add back our custom linking plugins to pnpm

This commit is contained in:
Timo K
2026-04-20 16:59:34 +02:00
parent 4d86580542
commit 66cea929a7
7 changed files with 100 additions and 29 deletions
+5 -4
View File
@@ -1,11 +1,12 @@
#!/usr/bin/sh
FILE=.links.temp-disabled.yaml
if test -f "$FILE"; then
FILE=.links.cjs
FILE_DIS=.links.temp-disabled.cjs
if test -f "$FILE_DIS"; then
# Only do the post-commit hook if the file was temp-disabled by the pre-commit hook.
# Otherwise linking was actively (`yarn links:disable`) disabled and this hook should noop.
mv .links.temp-disabled.yaml .links.yaml
mv $FILE_DIS $FILE
yarnLog=$(yarn)
echo "[yarn-linker] The post-commit hook has re-enabled .links.yaml."
echo "[yarn-linker] The post-commit hook has re-enabled $FILE"
exit 1
fi
+6 -5
View File
@@ -1,11 +1,12 @@
#!/usr/bin/sh
FILE=".links.yaml"
FILE=.links.cjs
FILE_DIS=.links.temp-disabled.cjs
if test -f "$FILE"; then
mv .links.yaml .links.temp-disabled.yaml
mv $FILE .links.temp-disabled.cjs
# echo "running yarn"
x=$(yarn)
y=$(git add yarn.lock)
echo "[yarn-linker] The pre-commit hook has disabled .links.yaml and MODIFIED the yarn.lock file. Review the staged changes (the hook added yarn.lock, was this desired?) and run \`git commit \` again if they look okay. The post-commit hook will re-enable your links."
x=$(pnpm install)
y=$(git add pnpm-lock.yaml)
echo "[yarn-linker] The pre-commit hook has disabled $FILE and MODIFIED the pnpm-lock.yaml file. Review the staged changes (the hook added pnpm-lock.yaml, was this desired?) and run \`git commit \` again if they look okay. The post-commit hook will re-enable your links."
exit 1
fi