From 8df5d6476862712fbb3afcd31288348a55e9f6b0 Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Wed, 14 Aug 2024 02:15:11 +0200 Subject: [PATCH] Workaround to allow absolute file paths Previously absolute paths threw `File exists` after `subdir = outdir / filename` reduced to `subdir = filename`. --- yaml_shellcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaml_shellcheck.py b/yaml_shellcheck.py index fc324b3..1eff8b8 100755 --- a/yaml_shellcheck.py +++ b/yaml_shellcheck.py @@ -394,7 +394,7 @@ def write_tmp_files(args, data): outdir = Path(args.outdir) outdir.mkdir(exist_ok=True, parents=True) for filename in data: - subdir = outdir / filename + subdir = outdir / ('a/'+filename) # remove all '..' elements from the tmp file paths if ".." in subdir.parts: parts = filter(lambda a: a != "..", list(subdir.parts))