license-tool/install.sh

19 lines
375 B
Bash
Raw Normal View History

#!/bin/sh -e
2022-10-06 22:34:56 -07:00
PREFIX="/usr/local"
if [ "$#" -ge 1 ]; then
PREFIX="$1"
fi
export GLOBAL_DATA_PATH="$PREFIX/share/license-tool"
cargo clean --release
cargo build --release
2022-10-06 22:34:56 -07:00
sudo sh << EOF
cp target/release/license-tool "$PREFIX/bin/license-tool"
printf "Installing licenses to '%s'\n" "$GLOBAL_DATA_PATH"
rm -rf "$GLOBAL_DATA_PATH"
cp -R licenses "$GLOBAL_DATA_PATH"
EOF