tooling: notify team members if package.json/yarn has been updated (#2972)

This is a team tooling thing to let each other know if `yarn` needs to
be run upon checkout of a branch.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package[^2]
This commit is contained in:
Mime Čuvalo 2024-02-28 10:50:48 +00:00 committed by GitHub
parent 98be39d6f8
commit b1e168b207
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 1 deletions

View file

@ -1,4 +1,15 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
rm -rf *.tsbuildinfo */*.tsbuildinfo */*/*.tsbuildinfo */*/*/*.tsbuildinfo */*/*/*/*.tsbuildinfo
set -e
rm -rf *.tsbuildinfo */*.tsbuildinfo */*/*.tsbuildinfo */*/*/*.tsbuildinfo */*/*/*/*.tsbuildinfo
# This notifies the user if the yarn.lock file has changed.
CHANGED=$(git diff "$1" "$2" --stat -- ./yarn.lock | wc -l)
if (( CHANGED > 0 )); then
echo
echo "🚨 🚨 🚨 yarn.lock has changed! 🚨 🚨 🚨 "
echo "run 'yarn' to get the latest!"
echo
fi

13
.husky/post-merge Normal file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
set -e
# This notifies the user if the yarn.lock file has changed.
CHANGED=$(git diff HEAD@{1} --stat -- ./yarn.lock | wc -l)
if (( CHANGED > 0 )); then
echo
echo "🚨 🚨 🚨 yarn.lock has changed! 🚨 🚨 🚨 "
echo "run 'yarn' to get the latest!"
echo
fi