Add a .links.temp-disabled.yaml state explicitly for when the pre-commit hook disabled the yaml file. otherwise we end up with a linked repo after every commit. (#3210)

This commit is contained in:
Timo authored and GitHub committed 2025-04-16 19:39:08 +02:00
1 parent a839cde34f
commit 78a88a9e0b
3 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -1,10 +1,10 @@
#!/usr/bin/sh
FILE=.links.disabled.yaml
FILE=.links.temp-disabled.yaml
if test -f "$FILE"; then
# echo "$FILE exists. -> moving to .links.disabled.yaml"
mv .links.disabled.yaml .links.yaml
# echo "running yarn"
# 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
yarnLog=$(yarn)
echo "[yarn-linker] The post-commit hook has re-enabled .links.yaml."
exit 1
+1 -2
View File
@@ -2,8 +2,7 @@
FILE=".links.yaml"
if test -f "$FILE"; then
# echo "$FILE exists. -> moving to .links.disabled.yaml"
mv .links.yaml .links.disabled.yaml
mv .links.yaml .links.temp-disabled.yaml
# echo "running yarn"
x=$(yarn)
y=$(git add yarn.lock)