There was an error while loading. Please reload this page.
1 parent 0aba330 commit 36c9a6fCopy full SHA for 36c9a6f
scripts/create_solution.sh
100755
100644
scripts/remove_code_section.sh
@@ -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