Skip to content

Instantly share code, notes, and snippets.

@kevinAlbs
Created November 29, 2022 18:27
Show Gist options
  • Save kevinAlbs/96f052ca6287c5c8a6a5012a327cdb6c to your computer and use it in GitHub Desktop.
Save kevinAlbs/96f052ca6287c5c8a6a5012a327cdb6c to your computer and use it in GitHub Desktop.
PR=${PR:-}
REPO=${REPO:-}
ORG=${ORG:-mongodb}
if [[ "$(basename $(pwd))" != "review" ]]; then
echo "Must be in 'review' directory";
exit 1;
fi
if [[ -z "$PR" ]]; then
echo "Set PR environment variable to the GitHub PR number";
exit 1;
fi
if [[ -z "$REPO" ]]; then
echo "Set REPO environment variable to the <repo> name. E.g. 'mongo-c-driver'";
exit 1;
fi
git clone git@github.com:$ORG/$REPO.git $REPO-$PR
cd $REPO-$PR
HELPERS=/Users/kevin.albertson/scripts/repo-helpers/$REPO
if [[ -d $HELPERS ]]; then
ln -s $HELPERS .h
fi
git remote add kevinAlbs git@github.com:kevinAlbs/$REPO.git
gh pr checkout $PR
# Check if there is a .vscode directory:
if [ -d /Users/kevin.albertson/code/$REPO/.vscode ]; then
cp -R /Users/kevin.albertson/code/$REPO/.vscode .vscode
fi
code .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment