Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heoh
heoh / multiple-git-hooks.sh
Last active December 11, 2019 04:00 — forked from mjackson/multiple-git-hooks.sh
Run multiple scripts for the same git hook
#!/bin/bash
# This script should be saved in a git repo as a hook file, e.g. .git/hooks/pre-receive.
# It looks for scripts in the .git/hooks/pre-receive.d directory and executes them in order,
# passing along stdin. If any script exits with a non-zero status, this script exits.
local_script_dir=".git/hooks"
script_dir=$(dirname $0)
hook_name=$(basename $0)