mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-21 15:36:50 -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
|
||||||
6
upcoming-release-notes/7230.md
Normal file
6
upcoming-release-notes/7230.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
category: Maintenance
|
||||||
|
authors: [MatissJanis]
|
||||||
|
---
|
||||||
|
|
||||||
|
Run `yarn install` when switching branches if `yarn.lock` changed
|
||||||
Reference in New Issue
Block a user