Created
January 8, 2013 08:41
-
-
Save abaez/4482233 to your computer and use it in GitHub Desktop.
Simple install from Sublime Text 2
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 | |
#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