Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A single simple script to update PhpStorm on Linux and create a desktop shortcut
#!/bin/bash
#
# Heavily based on https://gist.github.com/olivertappin/e5920e131db9a451c91aa6e2bc24dc40
#
INSTALL_DIR=/home/bondt/work/bin/phpstorm
#if [ "$(whoami)" != "root" ]
#then
# echo "Sorry, you are not root. Use sudo!"
# exit 1
#fi
echo "Downloading the latest PhpStorm to /tmp"
cd /tmp
curl -Lo PhpStorm.tar.gz "https://data.services.jetbrains.com/products/download?code=PS&platform=linux"
echo "Extracting..."
tar -xzf /tmp/PhpStorm.tar.gz
rm /tmp/PhpStorm.tar.gz
echo "Removing old PhpStorm..."
rm -rf $INSTALL_DIR
echo "Copying new PhpStorm..."
mv /tmp/PhpStorm* $INSTALL_DIR
echo "New PhpStorm has been installed!"
echo "Creating phpstorm.desktop file..."
cat > ~/Desktop/PhpStorm.desktop <<EOL
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon=$INSTALL_DIR/bin/phpstorm.png
Name=PhpStorm
Exec="$INSTALL_DIR/bin/phpstorm.sh" %f
Name=PhpStorm
Icon=$INSTALL_DIR/bin/phpstorm.png
Comment=The Drive to Develop
EOL
chmod 755 ~/Desktop/PhpStorm.desktop
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.