Skip to content

Instantly share code, notes, and snippets.

@jwhitlark
Created February 28, 2019 19:17
Show Gist options
  • Select an option

  • Save jwhitlark/9d2e78a9f1d845a2b6788bd662ffc5a5 to your computer and use it in GitHub Desktop.

Select an option

Save jwhitlark/9d2e78a9f1d845a2b6788bd662ffc5a5 to your computer and use it in GitHub Desktop.
Autoclone ...xyz/$GITUSER/$GITREPO into the current directory, when direnv is installed.
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
@jwhitlark

jwhitlark commented Feb 28, 2019

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment