install.sh 804 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/env sh
  2. # check sudo permissions
  3. if (( "$EUID" != 0 )); then
  4. echo "Please run this script with sudo"
  5. exit 1
  6. fi
  7. INSTALL_PATH=/usr/share/java/jls
  8. VERSION=0.3.5
  9. mkdir -p "$INSTALL_PATH"
  10. echo "Install version: $VERSION"
  11. echo "Downloading jar file..."
  12. sudo wget "https://github.com/Anas-Elgarhy/jls/releases/download/$VERSION/jls.jar"
  13. sudo mv ./jls.jar "$INSTALL_PATH"/jls.jar
  14. printf "\nDownloaded in %s/jls.jar\n" $INSTALL_PATH
  15. echo "Create the executable file in /bin"
  16. # shellcheck disable=SC2024
  17. sudo echo "exec /usr/bin/java -jar $INSTALL_PATH/jls.jar \$@" >> /bin/jls
  18. sudo chmod +x /bin/jls
  19. printf "\nDone, enjoy :D\n"
  20. echo "Please type jls --help to show the available options"
  21. echo "If the icons do not appear or appear wrongly, please make sure that you have installed nerd font"