Skip to content

Commit

Permalink
Update generator to use configlet create (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
BNAndras authored Apr 24, 2024
1 parent f4d080f commit 88e7e13
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions bin/generate_practice_exercise
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,7 @@ echo "Fetching latest version of configlet..."

# Preparing config.json
echo "Adding instructions and configuration files..."
UUID=$(bin/configlet uuid)
jq --arg slug "$SLUG" --arg uuid "$UUID" \
'.exercises.practice += [{slug: $slug, name: "TODO", 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": 2.0/' config.json.tmp
mv config.json.tmp config.json

# Create instructions and config files
./bin/configlet sync --update --yes --docs --filepaths --metadata --exercise "$SLUG"
./bin/configlet create --practice-exercise "$SLUG"

pushd tools
emacs -batch -l install-packages.el -l practice-exercise-generator.el --eval "(exercism/generate-practice-exercise \"$SLUG\")"
Expand Down

0 comments on commit 88e7e13

Please sign in to comment.