Created
January 6, 2011 00:05
-
-
Save dcolish/767271 to your computer and use it in GitHub Desktop.
If you use HG or GIT, now you dont need to remember type of repo you're in
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 selectvcs() { | |
case `stat -qn -f "%N" $1/.{git,hg}` in | |
*.git) echo "git" ;; | |
*.hg) echo "hg" ;; | |
//./) exit -1 ;; | |
*) $(selectvcs "`dirname ${1}`") ;; | |
esac | |
} | |
$(selectvcs $PWD) $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I like stat!