Skip to content

Commit f1b56c7

Browse files
Update bootstrap_practice_exercise (#226)
1 parent 3666799 commit f1b56c7

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

bin/bootstrap_practice_exercise.sh

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,12 @@ exercise_dir="exercises/practice/${SLUG}"
1616
echo "Fetching latest version of configlet..."
1717
./bin/fetch-configlet
1818

19-
# Preparing config.json
20-
echo "Adding instructions and configuration files..."
21-
NAME=$(echo $SLUG | sed -e 's/-/ /g' -e 's/\b\(.\)/\u\1/g' )
22-
UUID=$(bin/configlet uuid)
23-
jq --arg slug "$SLUG" --arg name "$NAME" --arg uuid "$UUID" \
24-
'.exercises.practice += [{slug: $slug, name: $name, uuid: $uuid, practices: [], prerequisites: [], difficulty: 5}]' \
25-
config.json > config.json.tmp
26-
# jq always rounds whole numbers, but average_run_time needs to be a float
27-
sed -i 's/"average_run_time": \([[:digit:]]\+\)$/"average_run_time": \1.0/' config.json.tmp
28-
mv config.json.tmp config.json
19+
if [[ -z $author ]]; then
20+
echo
21+
read -rp "What's your github username? " author
22+
fi
2923

30-
# Create instructions and config files
31-
./bin/configlet sync --update --yes --docs --metadata --exercise "$SLUG"
32-
./bin/configlet sync --update --yes --filepaths --exercise "$SLUG"
33-
./bin/configlet sync --update --tests include --exercise "$SLUG"
24+
bin/configlet create --practice-exercise $SLUG --author "${author}" --difficulty 5
3425

3526
# Create V files
3627
touch $exercise_dir/.meta/example.v

0 commit comments

Comments
 (0)