Skip to content

Instantly share code, notes, and snippets.

@jlabs
Created March 6, 2024 12:26
Show Gist options
  • Save jlabs/6989c9b0de088cea5e3e4380ab3d4cb2 to your computer and use it in GitHub Desktop.
Save jlabs/6989c9b0de088cea5e3e4380ab3d4cb2 to your computer and use it in GitHub Desktop.
Git hook for DDEV + Craft CMS changes on git pull
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 "ddev composer install"
check_run package.json "ddev npm i"
check_run "/config/project/" "ddev craft project-config/apply"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment