Created
February 28, 2019 19:17
-
-
Save jwhitlark/9d2e78a9f1d845a2b6788bd662ffc5a5 to your computer and use it in GitHub Desktop.
Autoclone ...xyz/$GITUSER/$GITREPO into the current directory, when direnv is installed.
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
PARENT=$(basename $PWD) | |
GRANDPARENT=$(basename $(dirname $PWD)) | |
REPOPATH=$GRANDPARENT/$PARENT | |
if [ ! -d .git ]; then | |
echo "Cloning $REPOPATH into $PWD" | |
tfile=$(mktemp /tmp/envrc.XXXXXXXXX) | |
mv .envrc $tfile | |
git clone https://github.com/$REPOPATH.git ./ | |
mv $tfile .envrc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If it does exist, tell me if I'm up to date with origin and upstream? Probably can be done with a git prompt thing.