-
-
Save mslinn/7960118 to your computer and use it in GitHub Desktop.
Opens Sublime Text
This file contains hidden or 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 | |
# Assumes you have defined subl command | |
# See http://www.sublimetext.com/docs/2/osx_command_line.html | |
# See http://www.sublimetext.com/forum/viewtopic.php?f=4&t=10473 | |
if [ "$1" ]; then # open given file(s) or directory/directories | |
subl "$@" & | |
else # no arguments | |
PRJ=`ls -1 *.sublime-project 2> /dev/null` | |
if [ "$PRJ" ]; then # At least one project exists in current folder, open them all | |
for P in "$PRJ"; do | |
subl --project "$P" & | |
done | |
else # no file specified and no projects available so open current directory | |
subl . & | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment