Skip to content

Instantly share code, notes, and snippets.

@szeiger
Created October 10, 2013 18:37
Show Gist options
  • Save szeiger/6923268 to your computer and use it in GitHub Desktop.
Save szeiger/6923268 to your computer and use it in GitHub Desktop.
#!/bin/bash
function isIdeaProject() {
dirn=`dirname "$1"`
if [ "$dirn" = "/" ]; then
false
elif [ -d "$dirn/.idea" ]; then
true
else
isIdeaProject "$dirn"
fi
}
if isIdeaProject "$1"; then
~/bin/idea --line $2 "$1"
else
/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl "$1:$2"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment