Skip to content

Commit

Permalink
generate: Genereate dir with commit ref included
Browse files Browse the repository at this point in the history
Also actually allow --num-instructions as a valid arg.

Make sure we move off the pr branch before trying to delete it and
fetch a new pr branch.

Signed-off-by: Russell Bryant <[email protected]>
  • Loading branch information
russellb committed Mar 14, 2024
1 parent 973a86f commit 01ddd1b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ generate() {
fi
cd taxonomy || exit 1
git fetch origin
git checkout main
git branch -D "pr-${PR_ID}" 2>/dev/null
git fetch origin "pull/${PR_ID}/head:pr-${PR_ID}"
git checkout "pr-${PR_ID}"
OUTPUT_DIR="generate-pr-${PR_ID}-$(git rev-parse --short HEAD)"
cd ..
OUTPUT_DIR="generate-pr-${PR_ID}"
mkdir -p "$OUTPUT_DIR"
lab generate --output-dir "$OUTPUT_DIR" --num-instructions "${NUM_INSTRUCTIONS}"
}
Expand All @@ -68,6 +69,10 @@ while [ $# -gt 0 ]; do
usage
exit 0
;;
--num-instructions)
NUM_INSTRUCTIONS="$2"
shift
;;
--venv-dir)
VENV_DIR="$2"
shift
Expand Down

0 comments on commit 01ddd1b

Please sign in to comment.