Skip to content

Commit 5a183b7

Browse files
committed
Remove empty lines
1 parent 98e9fae commit 5a183b7

File tree

5 files changed

+1
-21
lines changed

5 files changed

+1
-21
lines changed

bin/add_practice_exercise

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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
4041
if [ -e bin/configlet ]; then
4142
message "success" "Configlet found!"
4243
else
@@ -57,7 +58,6 @@ canonical_json=$(bin/fetch_canonical_data "$slug")
5758
has_canonical_data=true
5859
if [ "${canonical_json}" == "404: Not Found" ]; then
5960
has_canonical_data=false
60-
6161
message "warning" "This exercise doesn't have canonical data"
6262

6363
else
@@ -81,7 +81,6 @@ create_rust_files "$exercise_dir" "$slug" "$has_canonical_data"
8181
# ==================================================
8282

8383
# Build configlet
84-
8584
./bin/fetch-configlet
8685
message "success" "Fetched configlet successfully!"
8786

bin/generator-utils/colors.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ cyan=$(echo -e '\033[0;36m')
1010

1111
bold_green=$(echo -e '\033[1;32m')
1212

13-
1413
export red green blue yellow bold_green reset_color cyan

bin/generator-utils/prompts.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
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
76
source ./bin/generator-utils/colors.sh
87

98
get_exercise_difficulty() {
10-
119
read -rp "Difficulty of exercise (1-10): " exercise_difficulty
1210
echo "$exercise_difficulty"
1311
}
1412

15-
1613
validate_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-
3429
get_author_handle() {
3530
local default_author_handle
3631
default_author_handle="$(git config user.name)"

bin/generator-utils/templates.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ create_fn_name() {
2222
}
2323

2424
create_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-
120118
create_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")
@@ -139,7 +136,6 @@ EOT
139136
message "success" "Stub file for example.rs has been created!"
140137
}
141138

142-
143139
create_rust_files() {
144140

145141
local exercise_dir=$1

bin/generator-utils/utils.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
source ./bin/generator-utils/colors.sh
1010

1111
message() {
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-
4037
dash_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
}

0 commit comments

Comments
 (0)