install.sh 441 B

1234567891011121314151617181920
  1. #!/bin/sh -e
  2. PREFIX="/usr/local"
  3. if [ "$#" -ge 1 ]; then
  4. PREFIX="$1"
  5. fi
  6. export GLOBAL_DATA_PATH="$PREFIX/share/license-tool"
  7. cargo clean --release
  8. cargo build --release
  9. sudo sh << EOF
  10. cp target/release/license-tool "$PREFIX/bin/license-tool"
  11. cp _license-tool "$PREFIX/share/zsh/site-functions/_license-tool"
  12. printf "Installing licenses to '%s'\n" "$GLOBAL_DATA_PATH"
  13. rm -rf "$GLOBAL_DATA_PATH"
  14. cp -R licenses "$GLOBAL_DATA_PATH"
  15. EOF