Skip to content

Instantly share code, notes, and snippets.

@stevensd2m
Created July 2, 2019 14:28
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 stevensd2m/def59dec214332352c4f5578e13046d8 to your computer and use it in GitHub Desktop.
Save stevensd2m/def59dec214332352c4f5578e13046d8 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/dagjaneiro/1a5eb238d8d0738a630c0e3c6b756ccc/raw/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