Skip to content

Instantly share code, notes, and snippets.

@clbarnes
Last active April 6, 2016 20:06
Show Gist options
  • Select an option

  • Save clbarnes/8ed7c69a21b39582728fae074be7475e to your computer and use it in GitHub Desktop.

Select an option

Save clbarnes/8ed7c69a21b39582728fae074be7475e to your computer and use it in GitHub Desktop.
Requires sudo. Change username where indicated. Usage is `install_pycharm path/to/pycharm_archive.tar.gz`.
#!/bin/bash
set -e
USERNAME = "cbarnes" # change this
COMPRESSION = ".tar.gz"
STARTING_DIR = pwd
ARCHIVE_DIR = dirname $1
FOLDER_NAME = basename $1 $COMPRESSION
cd $ARCHIVE_DIR
tar -xzvf $1
mv $FOLDER_NAME "/opt/"
chmod 777 -R "/opt/$FOLDER_NAME" # allow pycharm to update itself
cd $STARTING_DIR
echo "Remember to import settings, and create a desktop shortcut!"
sudo -u $USERNAME "/opt/$FOLDER_NAME/bin/pycharm.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment