Skip to content

Instantly share code, notes, and snippets.

@abaez
Created January 8, 2013 08:41
Show Gist options
  • Save abaez/4482233 to your computer and use it in GitHub Desktop.
Save abaez/4482233 to your computer and use it in GitHub Desktop.
Simple install from Sublime Text 2
#!/bin/bash
#ONLY install 64bit version
#check stuff
# cd "$(dirname ${BASH_SOURCE[0]})"
# dir=${PWD##*/}
dir=/opt
cd $dir;
makeDirectory() {
curl -O http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2
tar xf *.tar.bz2; rm -rf *.tar.bz2
mv "Sublime Text 2" sublime
}
makeInstall() {
cd sublime
ln -s /opt/sublime/sublime_text /usr/bin/sublime
cat > /usr/share/applications/sublime.desktop <<-EOL
[Desktop Entry]
Name=Sublime Text 2
GenericName="Text Editor"
Exec=sublime
Terminal=false
Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png
Type=Application
Categories=TextEditor;IDE;Development
EOL
}
if [ ! -d "/opt/sublime" ]; then
echo "No real directory for the install, will make one now:"
makeDirectory
else
echo "Directory already exist"
fi
if [ ! -f "/usr/bin/sublime" ]; then
echo "Sublime isn't installed. Will do this now:"
makeInstall
else
echo "Sublime is already installed, stopping install."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment