File tree Expand file tree Collapse file tree 5 files changed +1
-21
lines changed Expand file tree Collapse file tree 5 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ command -v curl >/dev/null 2>&1 || {
3737 exit 1
3838}
3939
40+ # Check if configlet is already fetched
4041if [ -e bin/configlet ]; then
4142 message " success" " Configlet found!"
4243else
@@ -57,7 +58,6 @@ canonical_json=$(bin/fetch_canonical_data "$slug")
5758has_canonical_data=true
5859if [ " ${canonical_json} " == " 404: Not Found" ]; then
5960 has_canonical_data=false
60-
6161 message " warning" " This exercise doesn't have canonical data"
6262
6363else
@@ -81,7 +81,6 @@ create_rust_files "$exercise_dir" "$slug" "$has_canonical_data"
8181# ==================================================
8282
8383# Build configlet
84-
8584./bin/fetch-configlet
8685message " success" " Fetched configlet successfully!"
8786
Original file line number Diff line number Diff line change @@ -10,5 +10,4 @@ cyan=$(echo -e '\033[0;36m')
1010
1111bold_green=$( echo -e ' \033[1;32m' )
1212
13-
1413export red green blue yellow bold_green reset_color cyan
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3-
43# see comment in utils.sh
54# shellcheck source=bin/generator-utils/colors.sh
65# shellcheck source=./colors.sh
76source ./bin/generator-utils/colors.sh
87
98get_exercise_difficulty () {
10-
119 read -rp " Difficulty of exercise (1-10): " exercise_difficulty
1210 echo " $exercise_difficulty "
1311}
1412
15-
1613validate_difficulty_input () {
17-
1814 local valid_input=false
1915 while ! $valid_input ; do
2016 if [[ " $1 " =~ ^[1-9]$| ^10$ ]]; then
@@ -30,7 +26,6 @@ validate_difficulty_input() {
3026 echo " $exercise_difficulty "
3127}
3228
33-
3429get_author_handle () {
3530 local default_author_handle
3631 default_author_handle=" $( git config user.name) "
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ create_fn_name() {
2222}
2323
2424create_test_file_template () {
25-
2625 local exercise_dir=$1
2726 local slug=$2
2827 local has_canonical_data=$3
@@ -116,14 +115,12 @@ EOT
116115 message " success" " .gitignore has been overwritten!"
117116}
118117
119-
120118create_example_rs_template () {
121119
122120 local exercise_dir=$1
123121 local slug=$2
124122 local has_canonical_data=$3
125123
126-
127124 local fn_name
128125
129126 fn_name=$( create_fn_name " $slug " " $has_canonical_data " )
139136 message " success" " Stub file for example.rs has been created!"
140137}
141138
142-
143139create_rust_files () {
144140
145141 local exercise_dir=$1
Original file line number Diff line number Diff line change 99source ./bin/generator-utils/colors.sh
1010
1111message () {
12-
1312 local flag=$1
1413 local message=$2
1514
1615 case " $flag " in
17-
1816 " success" ) printf " ${green} %s${reset_color} \n" " [success]: $message " ;;
1917 " task" ) printf " ${cyan} %s${reset_color} \n" " [task]: $message " ;;
2018 " info" ) printf " ${blue} %s${reset_color} \n" " [info]: $message " ;;
@@ -36,9 +34,7 @@ message() {
3634 esac
3735}
3836
39-
4037dash_to_underscore () {
41-
4238 echo " $1 " | sed ' s/-/_/g'
4339}
4440
@@ -58,10 +54,8 @@ check_exercise_existence() {
5854 exit 1
5955 fi
6056
61-
6257 # Fetch configlet and crop out exercise list
6358 local unimplemented_exercises
64-
6559 unimplemented_exercises=$( bin/configlet info | sed -n ' /With canonical data:/,/Track summary:/p' | sed -e ' /\(With\(out\)\? canonical data:\|Track summary:\)/d' -e ' /^$/d' )
6660 if echo " $unimplemented_exercises " | grep -q " ^$slug $" ; then
6761 message " success" " Exercise has been found!"
@@ -78,11 +72,8 @@ ${unimplemented_exercises}"
7872 echo " ${yellow} $( bin/generator-utils/ngram " ${unimplemented_exercises} " " $slug " ) ${reset_color} "
7973 else
8074 message " info" " Building typo-checker binary for $( uname -m) system."
81-
8275 cd util/ngram && ./build && cd ../.. && echo " ${yellow} $( bin/generator-utils/ngram " ${unimplemented_exercises} " " $slug " ) ${reset_color} "
83-
8476 fi
85-
8677 exit 1
8778 fi
8879}
You can’t perform that action at this time.
0 commit comments