Created
October 30, 2023 03:39
-
-
Save bgoewert/9156b21b3bf5a7a71b6fb0e4dfd4de82 to your computer and use it in GitHub Desktop.
Install the latest PhpStorm
This file contains hidden or 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/sh | |
# Adapted from https://www.linuxbabe.com/ubuntu/install-phpstorm-ubuntu-18-04-18-10 | |
# Get the latest version number | |
re='PhpStorm\s\K[0-9]{4}\.[0-9]+(\.[0-9]+)?(?!\sEAP)' | |
jb=https://www.jetbrains.com/updates/updates.xml | |
latest=$(curl $jb 2>/dev/null | grep -Pom 1 $re) | |
dl="https://download.jetbrains.com/webide/PhpStorm-$latest.tar.gz" | |
sum="https://download.jetbrains.com/webide/PhpStorm-$latest.tar.gz.sha256" | |
# Download | |
cd ~/Downloads | |
wget "https://download.jetbrains.com/webide/PhpStorm-$latest.tar.gz" | |
# Checksum | |
checksum=$(curl "https://download.jetbrains.com/webide/PhpStorm-$latest.tar.gz.sha256" 2>/dev/null) | |
if ! echo $checksum | sha256sum -c -; then | |
echo "Checksum failed" >&2 | |
exit 1 | |
fi | |
# Extract | |
sudo tar xvf PhpStorm-$latest.tar.gz --directory /opt/ | |
# Run | |
path=$(ls -td /opt/* | head -n 1) | |
sh "$path/bin/phpstorm.sh" | |
# After PhpStorm starts, create a desktop shortcut from the settings menu. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment