Created
August 8, 2023 07:44
-
-
Save ktwrd/afd82422811d61496fac63fd6f30894d to your computer and use it in GitHub Desktop.
Install Jetbrains Toolbox (Linux)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -f ~/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox ]]; then | |
printf "Installing" | |
URL=$(curl -s 'https://data.services.jetbrains.com//products/releases?code=TBA&latest=true&type=release' | jq -r '.TBA[0].downloads.linux.link') | |
DOWNLOAD_TEMP_DIR=$(mktemp -d) | |
mkdir -p "${DOWNLOAD_TEMP_DIR}" | |
curl -L "${URL}" --output "${DOWNLOAD_TEMP_DIR}/toolbox.tar.gz" | |
TOOLBOX_TEMP_DIR=$(mktemp -d) | |
tar -C "$TOOLBOX_TEMP_DIR" -xf "${DOWNLOAD_TEMP_DIR}/toolbox.tar.gz" | |
rm "${DOWNLOAD_TEMP_DIR}/toolbox.tar.gz" | |
# for whatever stupid reasons bash doesn't expand the star here... | |
# it automatically installs itself into ~/.local/share/JetBrains/Toolbox/ | |
bash -c "${TOOLBOX_TEMP_DIR}/*/jetbrains-toolbox" | |
rm -rf "${TOOLBOX_TEMP_DIR}" | |
else | |
printf "Jetbrains: Already installed" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment