Generic-Template/setup.sh

132 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# Generic script to setup the repository for local development
echo "Installing pre-commit"
pip install pre-commit
pre-commit install
echo "Installing commit-msg"
HOOK_LOCATION=".git/hooks/commit-msg"
VERB_LOCATION=".git/hooks/verbs.txt"
cat << 'EOF' > "$HOOK_LOCATION"
#!/bin/sh
#
# Git hook to check for semantic commit messages in the form mentioned here
export VERB=$(cut -d ' ' -f1 < "$1")
(grep "$VERB" .git/hooks/verbs.txt > /dev/null) || (echo "Missing a verb"; exit 1)
EOF
chmod +x $HOOK_LOCATION
cat << 'EOF' > "$VERB_LOCATION"
Remove
Delete
Update
Be
Have
Do
Say
Go
Can
Get
Would
Make
Know
Will
Think
Take
See
Come
Could
Want
Look
Use
Find
Give
Tell
Work
May
Should
Call
Try
Ask
Need
Feel
Become
Leave
Put
Mean
Keep
Let
Begin
Seem
Help
Talk
Turn
Start
Might
Show
Hear
Play
Run
Move
Like
Live
Believe
Hold
Bring
Happen
Must
Write
Provide
Sit
Stand
Lose
Pay
Meet
Include
Continue
Set
Learn
Change
Lead
Understand
Watch
Follow
Stop
Create
Speak
Read
Allow
Add
Spend
Grow
Open
Walk
Win
Offer
Remember
Love
Consider
Appear
Buy
Wait
Serve
Die
Send
Expect
Build
Stay
Fall
Cut
Reach
Kill
Remain
Merge
Improve
EOF