From cd81d3bd72f073ff84865dbc35e85af2c9ed61b9 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Wed, 25 Jun 2025 04:37:40 -0400 Subject: [PATCH] feat: use hostname if $1 not present --- bin/joj3-forge-convert | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/joj3-forge-convert b/bin/joj3-forge-convert index 38afe6e..ea253a4 100755 --- a/bin/joj3-forge-convert +++ b/bin/joj3-forge-convert @@ -2,11 +2,10 @@ set -ex if [ -z "$1" ]; then - echo "error: course name is required" >&2 - exit 1 + COURSE=$(hostname | cut -d'/' -f2 | cut -d'-' -f1) +else + COURSE="$1" fi - -COURSE="$1" CONFIG_REPO_PATH="/home/tt/.cache/$COURSE-config" GRADING_REPO_PATH="/home/tt/.cache/$COURSE-joj" GIT_USER="bot-$COURSE"