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() {
|
2020-03-10 00:41:06 +03:00
|
|
|
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
|
2020-03-10 00:41:06 +03:00
|
|
|
ln -s "${NAVI_HOME}/target/tar/navi" "${BIN_DIR}/navi"
|
2020-03-05 00:01:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
uninstall() {
|
2020-03-10 00:41:06 +03:00
|
|
|
export SOURCE_DIR="${SOURCE_DIR:-"$(get_source_dir)"}"
|
2020-03-05 00:01:23 +03:00
|
|
|
rm -rf "${NAVI_HOME}/target"
|
2020-03-10 00:41:06 +03:00
|
|
|
rm "$SOURCE_DIR"
|
2020-03-05 00:01:23 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
cmd="$1"
|
|
|
|
shift
|
|
|
|
|
|
|
|
case "$cmd" in
|
|
|
|
"install") install "$@" ;;
|
|
|
|
"uninstall") uninstall "$@" ;;
|
|
|
|
esac
|