From a3505f95d3c459aecaec2c27aed991193d922526 Mon Sep 17 00:00:00 2001 From: Austin Macdonald Date: Sun, 15 Dec 2024 18:11:36 -0600 Subject: [PATCH] dont fail if output dir exists --- .github/scripts/create-file-index.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/scripts/create-file-index.py b/.github/scripts/create-file-index.py index c8ffc7f..5f8cb66 100755 --- a/.github/scripts/create-file-index.py +++ b/.github/scripts/create-file-index.py @@ -85,12 +85,13 @@ def directory_index(directory): directory = sys.argv[1] - # Ensure the output filename ends with .tsv for clarity - - os.makedirs(OUTPUT_DIR) + os.makedirs(OUTPUT_DIR, exist_ok=True) output_file = f"{OUTPUT_DIR}/{directory}-index.tsv" + file_index = MetadataWriter(output_file) file_index.start() + for filename, size, created, modified, error in directory_index(directory): file_index.write_row(filename, size, created, modified, error) + file_index.finish()