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:
@@ -1,10 +1,10 @@
|
|||||||
#!/usr/bin/sh
|
#!/usr/bin/sh
|
||||||
|
|
||||||
FILE=.links.disabled.yaml
|
FILE=.links.temp-disabled.yaml
|
||||||
if test -f "$FILE"; then
|
if test -f "$FILE"; then
|
||||||
# echo "$FILE exists. -> moving to .links.disabled.yaml"
|
# Only do the post-commit hook if the file was temp-disabled by the pre-commit hook.
|
||||||
mv .links.disabled.yaml .links.yaml
|
# Otherwise linking was actively (`yarn links:disable`) disabled and this hook should noop.
|
||||||
# echo "running yarn"
|
mv .links.temp-disabled.yaml .links.yaml
|
||||||
yarnLog=$(yarn)
|
yarnLog=$(yarn)
|
||||||
echo "[yarn-linker] The post-commit hook has re-enabled .links.yaml."
|
echo "[yarn-linker] The post-commit hook has re-enabled .links.yaml."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
FILE=".links.yaml"
|
FILE=".links.yaml"
|
||||||
if test -f "$FILE"; then
|
if test -f "$FILE"; then
|
||||||
# echo "$FILE exists. -> moving to .links.disabled.yaml"
|
mv .links.yaml .links.temp-disabled.yaml
|
||||||
mv .links.yaml .links.disabled.yaml
|
|
||||||
# echo "running yarn"
|
# echo "running yarn"
|
||||||
x=$(yarn)
|
x=$(yarn)
|
||||||
y=$(git add yarn.lock)
|
y=$(git add yarn.lock)
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ yarn-error.log
|
|||||||
!/.yarn/versions
|
!/.yarn/versions
|
||||||
/.links.yaml
|
/.links.yaml
|
||||||
/.links.disabled.yaml
|
/.links.disabled.yaml
|
||||||
|
/.links.temp-disabled.yaml
|
||||||
|
|
||||||
# Playwright
|
# Playwright
|
||||||
/test-results/
|
/test-results/
|
||||||
|
|||||||
Reference in New Issue
Block a user