Skip to content

Instantly share code, notes, and snippets.

@Bazze Bazze/setup.sh
Last active May 18, 2019

Embed
What would you like to do?
Bash script for setting up symlinked git hooks (that works)
#!/usr/bin/env bash
# 1. Save this script in your repo as "hooks/setup.sh"
# 2. Save your git hooks in "hooks/git/<hook name>"
# 3. Execute this script with bash
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${DIR}/.."
# Symlink git hooks
for filename in ${DIR}/git/*; do
filename=$(basename ${filename})
ln -s "../../hooks/git/${filename}" ".git/hooks/${filename}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.