Last active
January 20, 2025 12:12
-
-
Save jlabs/6989c9b0de088cea5e3e4380ab3d4cb2 to your computer and use it in GitHub Desktop.
Git hook for DDEV + Craft CMS changes on git pull
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} | |
check_run composer.json "composer install" | |
check_run package.json "npm i" | |
check_run "/config/project/" "php craft project-config/apply" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy to
.git/hooks/
aspost-merge
file. It then runs whenever commits are pulled and checks for changes