d2/ci/release/template/scripts/install.sh

17 lines
307 B
Bash
Raw Normal View History

2022-11-11 09:17:06 +00:00
#!/bin/sh
set -eu
2022-11-12 22:19:09 +00:00
cd -- "$(dirname "$0")/.."
. ./scripts/lib.sh
2022-11-11 09:17:06 +00:00
main() {
2022-11-12 22:19:09 +00:00
if [ ! -e "${PREFIX-}" ]; then
2022-11-11 09:17:06 +00:00
echoerr "\$PREFIX must be set to a unix prefix directory in which to install d2 like /usr/local"
2022-11-12 22:19:09 +00:00
return 1
2022-11-11 09:17:06 +00:00
fi
2022-11-12 22:19:09 +00:00
sh_c mkdir -p "$PREFIX"
2022-11-11 09:17:06 +00:00
sh_c install ./bin/d2 "$PREFIX/bin/d2"
}
main "$@"