Skip to content

Commit 36c9a6f

Browse files
committed
Adds a new script and modifies a existing one
1 parent 0aba330 commit 36c9a6f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

scripts/create_solution.sh

100755100644
File mode changed.

scripts/remove_code_section.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Directory containing the LeetCode solutions
4+
base_dir="solutions_leetCode"
5+
6+
# Iterate over all subdirectories
7+
for folder in "$base_dir"/*/; do
8+
# Check if metadata.json exists in the subdirectory
9+
metadata_file="${folder}metadata.json"
10+
if [[ -f "$metadata_file" ]]; then
11+
# Remove the "code" field from the JSON file
12+
jq 'del(.code)' "$metadata_file" > "${metadata_file}.tmp" && mv "${metadata_file}.tmp" "$metadata_file"
13+
echo "Removed 'code' section from $metadata_file"
14+
else
15+
echo "No metadata.json found in $folder"
16+
fi
17+
done
18+
19+
echo "Done! All 'code' sections have been removed from metadata.json files."

0 commit comments

Comments
 (0)