navi/scripts/make

31 lines
696 B
Plaintext
Raw Normal View History

2020-03-05 00:01:23 +03:00
#!/usr/bin/env bash
set -euo pipefail
##? make install
##? make uninstall
export NAVI_HOME="$(cd "$(dirname "$0")/.." && pwd)"
source "${NAVI_HOME}/scripts/install"
install() {
export SOURCE_DIR="${SOURCE_DIR:-"$(get_source_dir)"}"
export BIN_DIR="${BIN_DIR:-"$(get_bin_dir)"}"
echoerr "The final binary will be available at ${BIN_DIR}/navi..."
2020-03-05 00:01:23 +03:00
"${NAVI_HOME}/scripts/action" release
ln -s "${NAVI_HOME}/target/tar/navi" "${BIN_DIR}/navi"
2020-03-05 00:01:23 +03:00
}
uninstall() {
export SOURCE_DIR="${SOURCE_DIR:-"$(get_source_dir)"}"
2020-03-05 00:01:23 +03:00
rm -rf "${NAVI_HOME}/target"
rm "$SOURCE_DIR"
2020-03-05 00:01:23 +03:00
}
cmd="$1"
shift
case "$cmd" in
"install") install "$@" ;;
"uninstall") uninstall "$@" ;;
esac