Created
April 2, 2015 00:41
-
-
Save deanputney/a4019beaa5b245d0c326 to your computer and use it in GitHub Desktop.
subl alias - Prefers project files over opening folders
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
function subl { | |
if [ -z "$1" ] || [[ $1 = "." ]]; then | |
files=$(ls *.sublime-project 2> /dev/null | wc -l) | |
if [[ $files -eq 0 ]]; then | |
echo "Opening folder" | |
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl . | |
else | |
echo "Opening project" | |
open *.sublime-project | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment