Skip to content

Commit 2b43391

Browse files
committed
Add comments
1 parent b41be92 commit 2b43391

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/test_code.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
#!/bin/bash
22

3-
# Directorio a buscar
43
CATALOG_PATH="../catalog"
54
TMP_FOLDER="./tmp"
65

76
# Remove previous execution data
87
rm -rf "$TMP_FOLDER"
9-
10-
# Create Output Folder if not exist
118
mkdir -p "$TMP_FOLDER"
129

10+
# Function to place "API usage" code of node files in the correct place
1311
process_node_js_file() {
1412
awk '
1513
function process_node_js_file(file) {
@@ -79,6 +77,7 @@ process_node_js_file() {
7977
' "$1"
8078
}
8179

80+
# Function to place "API usage" code of python files in the correct place
8281
process_python_file() {
8382
awk '
8483
function process_python_file(file) {
@@ -137,6 +136,7 @@ BEGIN {
137136
' "$1"
138137
}
139138

139+
# Loop through samplecode_ files
140140
for samplecode_file in $(find "$CATALOG_PATH" -maxdepth 3 -type f -name "samplecode_*.md"); do
141141
# Extract the part of the file name between samplecode_ and .md
142142
filename=$(basename "$samplecode_file")
@@ -200,15 +200,16 @@ for samplecode_file in $(find "$CATALOG_PATH" -maxdepth 3 -type f -name "samplec
200200
print >> fileName
201201
}
202202
' "$samplecode_file"
203-
204-
# Fix node files to reorder code
203+
# At this point, we have a folder for each programming language and all the code blocks
204+
# that have the same title have been put together.
205+
# Reordering the code in the auth code node files
205206
for file in "$TMP_FOLDER/js/$name"/Auth_code*Node.js.js; do
206207
if [ -f "$file" ]; then
207208
process_node_js_file "$file"
208209
fi
209210
done
210211

211-
# Fix authcode python files
212+
# Reordering the code in the auth code python files
212213
for file in "$TMP_FOLDER/py/$name"/Auth_code*Python.py; do
213214
if [ -f "$file" ]; then
214215
process_python_file "$file"
@@ -217,7 +218,7 @@ for samplecode_file in $(find "$CATALOG_PATH" -maxdepth 3 -type f -name "samplec
217218
echo "Processing $name ==> $samplecode_file"
218219
done
219220

220-
# Execute test
221+
# Execute test and linter
221222
echo "################### Python test ##################################"
222223
python python_test.py
223224
echo "################### Node test ##################################"

0 commit comments

Comments
 (0)