You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git-secret/vendor/bats-core/uninstall.sh

40 lines
704 B
Bash

#!/usr/bin/env bash
set -e
BATS_ROOT="${0%/*}"
PREFIX="$1"
LIBDIR="${2:-lib}"
if [[ -z "$PREFIX" ]]; then
printf '%s\n' \
"usage: $0 <prefix>" \
" e.g. $0 /usr/local" >&2
exit 1
fi
d="$PREFIX/bin"
for elt in "$BATS_ROOT/bin"/*; do
elt=${elt##*/}
rm -f "$d/$elt"
done
d="$PREFIX/libexec/bats-core"
for elt in "$BATS_ROOT/libexec/bats-core"/*; do
elt=${elt##*/}
rm -f "$d/$elt"
done
[[ -d "$d" ]] && rmdir "$d"
d="$PREFIX/${LIBDIR}/bats-core"
for elt in "$BATS_ROOT/lib/bats-core"/*; do
elt=${elt##*/}
rm -f "$d/$elt"
done
[[ -d "$d" ]] && rmdir "$d"
rm -f "$PREFIX"/share/man/man1/bats.1
rm -f "$PREFIX"/share/man/man7/bats.7
echo "Uninstalled Bats from $PREFIX/bin/bats"