1
0
mirror of https://github.com/ciromattia/kcc synced 2026-05-13 02:52:20 +00:00

Use tempdir option for fusion path

* Update makeFusion to use the same temporary directory location
* Avoid creating an orphan "KCC-" in TMPDIR when --tempdir is set
This commit is contained in:
フィルターペーパー
2026-04-21 14:20:46 +08:00
committed by Alex Xu
parent a491810810
commit 4a6e4622ed

View File

@@ -1632,10 +1632,13 @@ def makeFusion(sources: List[str]):
raise UserWarning('Fusion requires at least 2 sources. Did you forget to uncheck fusion?')
start = perf_counter()
first_path = Path(sources[0])
fusion_parent = Path(gettempdir())
if options.tempdir:
fusion_parent = first_path.parent
if first_path.is_file():
fusion_path = first_path.parent.joinpath(first_path.stem + ' [fused]')
fusion_path = fusion_parent.joinpath(first_path.stem + ' [fused]')
else:
fusion_path = first_path.parent.joinpath(first_path.name + ' [fused]')
fusion_path = fusion_parent.joinpath(first_path.name + ' [fused]')
print("Running Fusion")
# Check if prefix is needed when user-specified ordering differs from OS natural sorting