Commit c90c438d authored by tywldx's avatar tywldx

fix

parent cab7c61d
#/usr/bin/env bash #/usr/bin/env bash
# git hook to run a command after `git pull` if a specified file was changed # git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() { check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2" havefile=`echo "$changed_files" | grep "$1"`
if [[ -n "${havefile}" ]];then
eval "$2"
fi
} }
check_run package.json "npm install" check_run package.json "npm install"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment