Skip to content

Instantly share code, notes, and snippets.

@truffaut
Last active August 29, 2015 13:57
Show Gist options
  • Save truffaut/9842951 to your computer and use it in GitHub Desktop.
Save truffaut/9842951 to your computer and use it in GitHub Desktop.
Create subl symlink with a bash script
#!/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