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

19 lines
403 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-14 21:00:52 +00:00
sh_c mkdir -p "$PREFIX/bin"
sh_c mkdir -p "$PREFIX/share/man/man1"
2022-11-11 09:17:06 +00:00
sh_c install ./bin/d2 "$PREFIX/bin/d2"
sh_c install ./man/d2.1 "$PREFIX/share/man/man1"
2022-11-11 09:17:06 +00:00
}
main "$@"