Created
January 12, 2021 11:53
-
-
Save migalmeida/28aef3688bf877616717739097ea4966 to your computer and use it in GitHub Desktop.
This file contains 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 characters
#!/bin/sh | |
repos="$(find . -name hooks -type d -maxdepth 3)" | |
printf $"\nInstalling Talkdesk prepare-commit-msg to:\n\n" | |
printf "$repos" | |
printf $"\n\n" | |
read -p $"continue [y/n]: " confirm | |
[ "$confirm" != 'y' ] && exit 1 | |
IFS=$'\n' read -rd '' -a rep_array <<<"$repos" | |
printf $"\n" | |
curl https://gist.githubusercontent.com/migalmeida/6c6fe9e15aaaeb0690d15beb2bce2411/raw/099c698fb452cbe5cb97045d33d1ad662c4c76ad/prepare-commit-msg -o prepare-commit-msg | |
chmod +x prepare-commit-msg | |
printf $"\n" | |
for r in "${rep_array[@]}"; do | |
printf $"Copying hook to $r\n" | |
cp prepare-commit-msg "$r"; | |
done | |
rm prepare-commit-msg | |
printf $"Done.\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment