1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00
rufus/_set_git_hooks.sh
Pete Batard 4a8c5be9c5 [misc] fix coverity warnings in drive.c
* Also apply minor fixes to rufus.loc and _set_git_hooks.sh
2018-05-15 10:23:45 +01:00

18 lines
696 B
Bash
Executable file

#!/bin/sh
# Sets the git hooks on a new git development system
if [ -e ".git/hooks/pre-commit" ] || [ -e ".git/hooks/post-commit" ] ; then
echo 'pre-commit or post-commit git hook is already set, aborting.'
exit
fi
echo 'Creating pre-commit git hook...'
echo '#!/bin/sh' > .git/hooks/pre-commit
echo 'if [ -x ./_pre-commit.sh ]; then' >> .git/hooks/pre-commit
echo ' . ./_pre-commit.sh' >> .git/hooks/pre-commit
echo 'fi' >> .git/hooks/pre-commit
echo 'Creating post-commit git hook...'
echo '#!/bin/sh' > .git/hooks/post-commit
echo 'if [ -x ./_post-commit.sh ]; then' >> .git/hooks/post-commit
echo ' . ./_post-commit.sh' >> .git/hooks/post-commit
echo 'fi' >> .git/hooks/post-commit