meanas/scripts/enable_git_hooks.sh

19 lines
441 B
Bash
Executable file

#!/bin/bash
set -Eeuo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
git config core.hooksPath .githooks
if [[ $# -ge 1 ]]; then
git config meanas.docsSiteUrl "$1"
fi
echo "Configured core.hooksPath=.githooks"
if git config --get meanas.docsSiteUrl >/dev/null 2>&1; then
echo "Configured meanas.docsSiteUrl=$(git config --get meanas.docsSiteUrl)"
else
echo "No meanas.docsSiteUrl configured"
fi