-
-
Save doxt3r/f474912f0aea57b821c23f35df66bb65 to your computer and use it in GitHub Desktop.
Install/Update phpstorm on Debian/Ubuntu-based linux.
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/bash -e | |
# Original credits to theodorosploumis | |
# IMPORTANT. My phpstom installation exists on /opt/. | |
if [ "$(whoami)" != "root" ] | |
then | |
echo "Sorry, you are not root." | |
exit 1 | |
fi | |
# Remove old Phpstorm | |
# old installation may use Phpstorm-* as folder, it is better to use find to locate folder. | |
echo "Removing old PhpStorm" | |
find /opt/ -maxdepth 1 -iname "phpstorm" -exec rm -rf {} \; | |
# Download file from url | |
echo "Downloading PhpStorm to /tmp" | |
wget -O /tmp/phpstorm.tar.gz "https://data.services.jetbrains.com/products/download?code=PS&platform=linux" --no-check-certificate | |
# Unpacking file | |
tar -xzf /tmp/phpstorm.tar.gz -C /tmp | |
rm /tmp/phpstorm.tar.gz | |
# Copy new Phpstorm | |
echo "Copying new PhpStorm" | |
mv /tmp/PhpStorm* /opt/phpstorm | |
#fix permissions for phpstorm minor auto-updates | |
chown $USER:$USER -R /opt/phpstorm | |
#(re) create desktop shotcut | |
echo "(Re) create desktop shotcut" | |
FILE="/home/$(logname)/.local/share/applications/jetbrains-phpstorm.desktop" | |
cat > $FILE <<EOF | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=PhpStorm | |
Icon=/opt/phpstorm/bin/phpstorm.png | |
Exec="/opt/phpstorm/bin/phpstorm.sh" %f | |
Comment=The Drive to Develop | |
Categories=Development;IDE; | |
Terminal=false | |
StartupWMClass=jetbrains-phpstorm | |
EOF | |
# Finish | |
echo "New PhpStorm has been installed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment