mirror of
https://github.com/AdguardTeam/AdguardFilters.git
synced 2026-08-29 12:14:41 +00:00
* migrate from Yarn to npm package manager and update dependencies * update CODEOWNERS file with new ownership assignments and reorder entries
18 lines
840 B
Plaintext
Executable File
18 lines
840 B
Plaintext
Executable File
# See https://git-scm.com/docs/githooks#_post_merge
|
|
|
|
# This function checks if a file has changed between the current HEAD and the previous HEAD
|
|
# Source: https://jshakespeare.com/use-git-hooks-and-husky-to-tell-your-teammates-when-to-run-npm-install
|
|
function changed {
|
|
# HEAD@{1} is the original position of HEAD before the merge
|
|
# HEAD is the new merge commit
|
|
# --name-only only shows the names of the changed files
|
|
# grep "^$1" only shows the files that match the first argument
|
|
git diff --name-only HEAD@{1} HEAD | grep "^$1" > /dev/null 2>&1
|
|
}
|
|
|
|
# If package.json or package-lock.json is changed, we should sync local dependencies
|
|
if changed "package.json" || changed "package-lock.json"; then
|
|
echo "package.json or package-lock.json changed, running npm install to sync dependencies"
|
|
npm install --force
|
|
fi
|