Last active
August 29, 2015 13:57
-
-
Save truffaut/9842951 to your computer and use it in GitHub Desktop.
Create subl symlink with a bash script
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 | |
if [ ! -h ~/bin/subl ]; then | |
if [ -f /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ]; then | |
echo "Creating subl link to Sublime Text" | |
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl ~/bin/subl | |
elif [ -f /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl ]; then | |
echo "Creating subl link to Sublime Text 2" | |
ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl ~/bin/subl | |
elif [ -f /Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl ]; then | |
echo "Creating subl link to Sublime Text 3" | |
ln -s /Applications/Sublime\ Text\ 3.app/Contents/SharedSupport/bin/subl ~/bin/subl | |
else | |
echo "Install Sublime Text first" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment