Merge pull request #25087 from woocommerce/add/post-merge

Introduced GIT post-merge hook to update NPM and Composer dependencies
This commit is contained in:
Claudio Sanches 2020-01-29 18:24:08 -03:00 committed by GitHub
commit 641a4c1890
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

10
bin/post-merge.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
runOnChange() {
echo "$changedFiles" | grep -q "$1" && eval "$2"
}
runOnChange "package-lock.json" "npm install"
runOnChange "composer.lock" "composer install"

View File

@ -71,7 +71,8 @@
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
"pre-commit": "lint-staged",
"post-merge": "./bin/post-merge.sh"
}
},
"lint-staged": {