Skip to content

Instantly share code, notes, and snippets.

@bondt
Created September 19, 2017 12:59
Show Gist options
  • Save bondt/64e1f914a87ac281ce26c16bf835d9a0 to your computer and use it in GitHub Desktop.
Save bondt/64e1f914a87ac281ce26c16bf835d9a0 to your computer and use it in GitHub Desktop.
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