Created
February 1, 2011 09:14
-
-
Save irohiroki/805622 to your computer and use it in GitHub Desktop.
A shell function that clones a github project into a directory of its account name.
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
# clone a github project | |
function clone { | |
# check arguments | |
acc=${1%%/*} | |
prj=${1##*/} | |
if [ -z "$acc" -o -z "$prj" ] ; then | |
echo 'usage: clone <github_account>/<project>' | |
return 1 | |
fi | |
# mkdir of the account name | |
if [ ! -d "$acc" ] ; then | |
mkdir $acc || return 1 | |
fi | |
git clone https://github.com/$acc/$prj.git $acc/$prj | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment