pinch/uninstall.sh
2022-11-16 11:03:12 +01:00

21 lines
484 B
Bash
Executable file

#!/usr/bin/env bash
current_path=$(realpath $0)
hook_base=${current_path%/*}
if [[ ! -e $hook_base/data/install ]]; then
echo "Pinch not installed. Consider installing pinch using install.sh..." >&2
exit 1
fi
if [[ -r $hook_base/data/old_cfg ]]; then
old_cfg=$(cat $hook_base/data/old_cfg)
git config --global core.hooksPath $old_cfg
rm $hook_base/data/old_cfg
else
git config --global --unset core.hooksPath
fi
rm $hook_base/data/install
echo "Pinch uninstalled..."