git_template stuff

This commit is contained in:
Tyrel Souza 2017-02-15 12:38:00 -05:00
parent 2d1e60d2c7
commit e590542f82
No known key found for this signature in database
GPG Key ID: 2EECB5087209E6A5
5 changed files with 29 additions and 0 deletions

View File

@ -15,6 +15,7 @@ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/mas
rm -rf ~/.bash_aliases
rm -rf ~/.gitconfig
rm -rf ~/.gitignore
rm -rf ~/.git_template
rm -rf ~/.hushlogin
rm -rf ~/.vim
rm -rf ~/.vimrc
@ -25,6 +26,7 @@ rm -rf ~/.pythonstartup.py
ln -s $(pwd)/bash_aliases ~/.bash_aliases
ln -s $(pwd)/gitconfig ~/.gitconfig
ln -s $(pwd)/gitignore ~/.gitignore
ln -s $(pwd)/git_template ~/.git_template
ln -s $(pwd)/hushlogin ~/.hushlogin
ln -s $(pwd)/vim ~/.vim
ln -s $(pwd)/vimrc ~/.vimrc

View File

@ -0,0 +1,4 @@
#!/bin/bash
if [ -e bin/update_dependencies.sh ]; then
bin/update_dependencies.sh
fi

4
git_template/hooks/post-merge Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
if [ -e bin/update_dependencies.sh ]; then
bin/update_dependencies.sh
fi

17
git_template/hooks/pre-push Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null
then
exit 0 # push will execute
fi
exit 1 # push will not execute
else
exit 0 # push will execute
fi

View File

@ -46,3 +46,5 @@
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[init]
templatedir = ~/.git_template