install_development_tools.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # fail if any commands fails
  3. set -e
  4. # debug log
  5. #set -x
  6. # Set superuser privileges command if not set
  7. if [[ -z $su ]]; then
  8. export su="sudo"
  9. fi
  10. #https://www.jetbrains.com/idea/download/download-thanks.html?platform=linux&code=IIC
  11. mkdir -p ~/bin
  12. cd ~/bin || return
  13. export INTELLIJ_VERSION=$(curl --silent "https://raw.githubusercontent.com/archlinux/svntogit-community/packages/intellij-idea-community-edition/trunk/PKGBUILD" | grep "pkgver=" | sed 's/pkgver=//')
  14. export INTELLIJ_DOWNLOAD_URL="https://download-cf.jetbrains.com/idea/ideaIC-${INTELLIJ_VERSION}.tar.gz"
  15. $su apt-get update -qq
  16. $su apt-get install -qq -y curl
  17. # Remove previous file
  18. rm -rf ideaIC-"${INTELLIJ_VERSION}".tar.gz
  19. # Download new version
  20. curl -L --silent "${INTELLIJ_DOWNLOAD_URL}" > ideaIC-"${INTELLIJ_VERSION}".tar.gz
  21. # Remove previous directory
  22. rm -rf ideaIC-"${INTELLIJ_VERSION}"
  23. # Remove previous symlink
  24. rm -f idea
  25. # Extract new version
  26. tar -xvf ideaIC-"${INTELLIJ_VERSION}".tar.gz
  27. mv idea-IC-* ideaIC-"${INTELLIJ_VERSION}"
  28. # Create new symlink
  29. ln -s ideaIC-"${INTELLIJ_VERSION}"/bin/idea.sh ~/bin/idea
  30. # vscodium
  31. mkdir -p ~/Applications
  32. cd ~/Applications || return
  33. curl -O -L "$(curl -s https://api.github.com/repos/VSCodium/vscodium/releases/latest | jq -r ".assets[] | select(.name | test(\"AppImage\")) | .browser_download_url" | head -n 1)"