From 67bff87aaf6083ca34b5a3efad34b8300a4c94d2 Mon Sep 17 00:00:00 2001 From: xyzroe Date: Tue, 23 Apr 2024 03:52:53 +0300 Subject: [PATCH] Update process_and_convert.py --- .github/scripts/process_and_convert.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/scripts/process_and_convert.py b/.github/scripts/process_and_convert.py index dc84a8d..e252492 100644 --- a/.github/scripts/process_and_convert.py +++ b/.github/scripts/process_and_convert.py @@ -62,3 +62,12 @@ def update_manifest(root, file, chip, version): chip = '_'.join(parts[:-1]) # Chip is everything before the date part version = parts[-1].split('.')[0] # Assuming the version is the last part before '.bin' update_manifest(root, file, chip, version) + +def clean_directory(directory): + for root, dirs, files in os.walk(directory): + for file in files: + if not (file.endswith(".bin") or file == "manifest.json"): + os.remove(os.path.join(root, file)) + +# Calling the clean_directory function to remove unwanted files +clean_directory('ti')