Skip to content

Commit

Permalink
Create output dir prior to writing report
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed Nov 8, 2024
1 parent 0191c85 commit 3eb9157
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/scripts/du.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def prepare_report(directory):
for user, data in report.items():
data["disk_usage_human_readable"] = bytes_to_human_readable(data["disk_usage_bytes"])


os.makedirs(os.path.dirname(OUTPUT_FILE), exist_ok=True)
with open(OUTPUT_FILE, 'w') as f:
json.dump(report, f, indent=4)

Expand All @@ -55,6 +55,7 @@ def prepare_report(directory):
path = sys.argv[1]
directories = [d for d in os.listdir(path) if os.path.isdir(os.path.join(path, d))]

os.makedirs(os.path.dirname(OUTPUT_FILE), exist_ok=True)
with open(OUTPUT_FILE, 'w') as f:
f.write("\n".join(directories))
# prepare_report(directory)

0 comments on commit 3eb9157

Please sign in to comment.