From e58c3d9ca0a1594de136c9906bfb2e3d03064081 Mon Sep 17 00:00:00 2001 From: Eric Willigers Date: Sat, 27 Jul 2024 23:53:18 +1000 Subject: [PATCH] Update bootstrap_practice_exercise --- bin/bootstrap_practice_exercise.sh | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/bin/bootstrap_practice_exercise.sh b/bin/bootstrap_practice_exercise.sh index e3e1e13..8150fa7 100755 --- a/bin/bootstrap_practice_exercise.sh +++ b/bin/bootstrap_practice_exercise.sh @@ -16,21 +16,12 @@ exercise_dir="exercises/practice/${SLUG}" echo "Fetching latest version of configlet..." ./bin/fetch-configlet -# Preparing config.json -echo "Adding instructions and configuration files..." -NAME=$(echo $SLUG | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' ) -UUID=$(bin/configlet uuid) -jq --arg slug "$SLUG" --arg name "$NAME" --arg uuid "$UUID" \ - '.exercises.practice += [{slug: $slug, name: $name, uuid: $uuid, practices: [], prerequisites: [], difficulty: 5}]' \ - config.json > config.json.tmp -# jq always rounds whole numbers, but average_run_time needs to be a float -sed -i 's/"average_run_time": \([[:digit:]]\+\)$/"average_run_time": \1.0/' config.json.tmp -mv config.json.tmp config.json +if [[ -z $author ]]; then + echo + read -rp "What's your github username? " author +fi -# Create instructions and config files -./bin/configlet sync --update --yes --docs --metadata --exercise "$SLUG" -./bin/configlet sync --update --yes --filepaths --exercise "$SLUG" -./bin/configlet sync --update --tests include --exercise "$SLUG" +bin/configlet create --practice-exercise $SLUG --author "${author}" --difficulty 5 # Create V files touch $exercise_dir/.meta/example.v