Forked from martinwheeler/yarn-composer-post-merge-and-checkout-hooks.sh
Last active
July 25, 2018 01:38
-
-
Save realyze/f2a53a4119f955ff63337af72ebbc5cf to your computer and use it in GitHub Desktop.
Revisions
-
realyze revised this gist
Jul 25, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ cd ~/.git-templates/hooks cat >post-checkout <<'EOL' changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" check_run() { echo "$changed_files" | grep -E --quiet "$1" && eval "$2" || true } # yarn all the things if yarn.lock has changed check_run "web/yarn.lock" "cd web && yarn" -
realyze renamed this gist
Jul 25, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
realyze revised this gist
Jul 25, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ check_run() { echo "$changed_files" | grep -E --quiet "$1" && eval "$2" } # yarn all the things if yarn.lock has changed check_run "web/yarn.lock" "cd web && yarn" EOL cp post-checkout ./post-merge && cp post-checkout ./post-fetch -
realyze revised this gist
Jul 25, 2018 . 1 changed file with 2 additions and 9 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,18 +6,11 @@ cd ~/.git-templates/hooks cat >post-checkout <<'EOL' changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" check_run() { echo "$changed_files" | grep -E --quiet "$1" && eval "$2" } # yarn all the things if yarn.lock has changed check_run "web/yarn.lock" "yarn install" EOL cp post-checkout ./post-merge && cp post-checkout ./post-fetch -
martinwheeler revised this gist
May 25, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,5 @@ check_run package.json "yarn install" check_run composer "composer install" EOL cp post-checkout ./post-merge && cp post-checkout ./post-fetch chmod -R a+x . -
martinwheeler created this gist
May 25, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ #/usr/bin/env bash git config --global init.templatedir '~/.git-templates' && \ mkdir -p ~/.git-templates/hooks && \ cd ~/.git-templates/hooks cat >post-checkout <<'EOL' changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" check_run() { echo "$changed_files" | grep -E --quiet "$1" && eval "$2" } # `npm install` and `npm prune` if the `package.json` file gets changed # to update all the nodejs ( grunt ) dependencies deleting the unused packages (not listed into the `package.json` file) check_run package.json "yarn install" # `composer install` if the `composer.json` file gets changed # to update all the php dependencies check_run composer "composer install" EOL cp post-checkout ./post-merge chmod -R a+x .