mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 06:58:47 -05:00
feat: Add post-checkout hook to run yarn install if yarn.lock changes (#7230)
This commit is contained in:
committed by
GitHub
parent
e1606b31ab
commit
5b227f5fa1
13
.husky/post-checkout
Executable file
13
.husky/post-checkout
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Run yarn install when switching branches (if yarn.lock changed)
|
||||
|
||||
# $3 is 1 for branch checkout, 0 for file checkout
|
||||
if [ "$3" != "1" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check if yarn.lock changed between the old and new HEAD
|
||||
if git diff --name-only "$1" "$2" | grep -q "^yarn.lock$"; then
|
||||
echo "yarn.lock changed — running yarn install..."
|
||||
yarn install
|
||||
fi
|
||||
Reference in New Issue
Block a user