-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from alexwilliams0712/sep_jetbrains_installer
sep_jetbrains_installer
- Loading branch information
Showing
2 changed files
with
81 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -o pipefail | ||
|
||
TMP_DIR="/tmp" | ||
INSTALL_DIR="$HOME/.local/share/JetBrains/Toolbox/bin" | ||
SYMLINK_DIR="$HOME/.local/bin" | ||
|
||
echo "### INSTALL JETBRAINS TOOLBOX ###" | ||
|
||
echo -e "\e[94mFetching the URL of the latest version...\e[39m" | ||
if [ "$(dpkg --print-architecture)" = "arm64" ]; then | ||
ARCHIVE_URL=$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' | grep -Po '"linux-aarch64":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g') | ||
else | ||
ARCHIVE_URL=$(curl -s 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release' | grep -Po '"linux":.*?[^\\]",' | awk -F ':' '{print $3,":"$4}'| sed 's/[", ]//g') | ||
fi | ||
ARCHIVE_FILENAME=$(basename "$ARCHIVE_URL") | ||
|
||
echo -e "\e[94mDownloading $ARCHIVE_FILENAME...\e[39m" | ||
rm "$TMP_DIR/$ARCHIVE_FILENAME" 2>/dev/null || true | ||
wget -q --show-progress -cO "$TMP_DIR/$ARCHIVE_FILENAME" "$ARCHIVE_URL" | ||
|
||
echo -e "\e[94mExtracting to $INSTALL_DIR...\e[39m" | ||
mkdir -p "$INSTALL_DIR" | ||
rm "$INSTALL_DIR/jetbrains-toolbox" 2>/dev/null || true | ||
tar -xzf "$TMP_DIR/$ARCHIVE_FILENAME" -C "$INSTALL_DIR" --strip-components=1 | ||
rm "$TMP_DIR/$ARCHIVE_FILENAME" | ||
chmod +x "$INSTALL_DIR/jetbrains-toolbox" | ||
|
||
echo -e "\e[94mSymlinking to $SYMLINK_DIR/jetbrains-toolbox...\e[39m" | ||
mkdir -p $SYMLINK_DIR | ||
rm "$SYMLINK_DIR/jetbrains-toolbox" 2>/dev/null || true | ||
ln -s "$INSTALL_DIR/jetbrains-toolbox" "$SYMLINK_DIR/jetbrains-toolbox" | ||
|
||
if [ -z "$CI" ]; then | ||
echo -e "\e[94mRunning for the first time to set-up...\e[39m" | ||
( "$INSTALL_DIR/jetbrains-toolbox" & ) | ||
echo -e "\n\e[32mDone! JetBrains Toolbox should now be running, in your application list, and you can run it in terminal as jetbrains-toolbox (ensure that $SYMLINK_DIR is on your PATH)\e[39m\n" | ||
else | ||
echo -e "\n\e[32mDone! Running in a CI -- skipped launching the AppImage.\e[39m\n" | ||
fi |
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