From 2151cf3f956d48189f3d0fa4d75ab5057b5450c1 Mon Sep 17 00:00:00 2001 From: Boris Kossev Date: Mon, 16 Oct 2023 11:28:28 +0200 Subject: [PATCH] add removal incl content --- .github/workflows/utils/generate-manifests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/utils/generate-manifests.py b/.github/workflows/utils/generate-manifests.py index 9b8dc80..d74b8ab 100755 --- a/.github/workflows/utils/generate-manifests.py +++ b/.github/workflows/utils/generate-manifests.py @@ -4,6 +4,7 @@ import sys import yaml import subprocess +import shutil def parse_yaml_files_in_directory(directory): @@ -70,8 +71,8 @@ def run_helm_template_cmd(chart_path, release_name, value_files, output_manifest def remove_directory_if_exists(directory_path): if os.path.exists(directory_path): try: - os.rmdir(directory_path) # Remove the directory - print(f"Directory '{directory_path}' removed.") + shutil.rmtree(directory_path) # Remove the directory + print(f"Directory incl. content '{directory_path}' removed.") return True except OSError as e: print(f"Error removing directory '{directory_path}': {str(e)}")