Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Chr1Z93 committed Nov 24, 2024
1 parent dabcde9 commit 34ebc93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@

def minify_json_files(directory):
directory_path = Path(directory)
if not directory_path.exists():
print(f"Directory does not exist: {directory}")
return

print(f"Processing directory: {directory}")
print(f"Found JSON files: {[file.name for file in directory_path.glob('*.json')]}")

for json_file in directory_path.glob("*.json"):
with open(json_file, "r", encoding="utf-8") as f:
data = json.load(f)

with open(json_file, "w", encoding="utf-8") as f:
json.dump(data, f, separators=(",", ":"), ensure_ascii=False)
print(f"Minified: {json_file}")


if __name__ == "__main__":
minify_json_files(OUTPUT_DIR)

0 comments on commit 34ebc93

Please sign in to comment.