Created
September 14, 2012 04:34
-
-
Save vojtajina/3719802 to your computer and use it in GitHub Desktop.
Shell script to start 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/sh | |
# Shell script to start Sublime | |
# @author Vojta Jina <[email protected]> | |
if [ -z $@ ]; then | |
# no arguments, try to find project | |
# TODO(vojta): traverse up to find projects in parent directories | |
PROJECT=`ls *.sublime-project 2>/dev/null` | |
if [ -e "$PROJECT" ]; then | |
# project exists in current folder, open it | |
sublime . --project "$PROJECT" | |
else | |
# no project, open current folder | |
sublime . | |
fi | |
else | |
# passing arguments, just forward them to sublime | |
sublime $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment