A local-first personal finance app
feat: Add post-checkout hook to run yarn install if yarn.lock changes (#7230)
Matiss Janis Aboltins5b227f5fa129
diff --git a/.husky/post-checkout b/.husky/post-checkoutnew file mode 100755index 0000000000..b72113be3f--- /dev/null+++ b/.husky/post-checkout@@ -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+fidiff --git a/upcoming-release-notes/7230.md b/upcoming-release-notes/7230.mdnew file mode 100644index 0000000000..037f4d714c--- /dev/null+++ b/upcoming-release-notes/7230.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [MatissJanis]+---++Run `yarn install` when switching branches if `yarn.lock` changed