Created
November 29, 2022 18:27
-
-
Save kevinAlbs/84c2c08e448bf8bf744dc752428f34ea to your computer and use it in GitHub Desktop.
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
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