generate-test-vars: use shutil.rmtree instead of rm

More portable.
This commit is contained in:
Jörg Thalheim
2025-04-21 15:03:42 +02:00
parent 74ef833dd3
commit 9780f45e97

View File

@@ -3,6 +3,7 @@
import argparse
import json
import os
import shutil
import subprocess
from dataclasses import dataclass
from pathlib import Path
@@ -127,7 +128,10 @@ def main() -> None:
os.environ["CLAN_NO_COMMIT"] = "1"
opts = parse_args()
test_dir = opts.repo_root / opts.test_dir
subprocess.run(["rm", "-rf", f"{test_dir}/vars", f"{test_dir}/sops"])
shutil.rmtree(test_dir / "vars", ignore_errors=True)
shutil.rmtree(test_dir / "sops", ignore_errors=True)
flake = Flake(str(opts.repo_root))
machines = [
TestMachine(name, flake, test_dir, opts.check_attr)