Skip to content

Instantly share code, notes, and snippets.

@migalmeida
Created January 12, 2021 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save migalmeida/28aef3688bf877616717739097ea4966 to your computer and use it in GitHub Desktop.
Save migalmeida/28aef3688bf877616717739097ea4966 to your computer and use it in GitHub Desktop.
#!/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