Skip to content

Commit

Permalink
Workaround to allow absolute file paths
Browse files Browse the repository at this point in the history
Previously absolute paths threw `File exists` after `subdir = outdir / filename`
reduced to `subdir = filename`.
  • Loading branch information
lukaw3d committed Aug 14, 2024
1 parent 8a09b2b commit 8df5d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yaml_shellcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 8df5d64

Please sign in to comment.