Created
September 19, 2017 12:59
-
-
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
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 | |
# | |
# 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