mas/script/uninstall

22 lines
433 B
Text
Raw Normal View History

2018-10-17 21:47:08 +00:00
#!/bin/bash -e
#
# script/uninstall
# mas
#
2021-05-07 18:33:39 +00:00
# Removes mas from PREFIX.
#
2018-10-17 21:47:08 +00:00
mas_dir="$(readlink -fn "$(dirname "${BASH_SOURCE:-"${0}"}")/..")"
if ! cd -- "${mas_dir}"; then
printf $'Error: Could not cd into mas directory: %s\n' "${mas_dir}" >&2
exit 1
fi
# Override default prefix path with optional 1st arg
PREFIX="${1:-"$(brew --prefix)"}"
2018-10-17 21:47:08 +00:00
echo "==> 🔥 Uninstalling mas from ${PREFIX}"
trash -F "${PREFIX}/bin/mas" || true