Skip to content

Commit 79ac550

Browse files
committed
fix(cli): add functionality to change output dir
Before, the --output option for the source-merge command was just ignored. Fixes: 3ad934d ("feat(merger): add infrastructure to create ...") Signed-off-by: Tamino Larisch <[email protected]>
1 parent d936bc2 commit 79ac550

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/debsbom/repack/merger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(
4141
):
4242
self.dldir = dldir
4343
self.outdir = outdir or dldir
44+
self.outdir.mkdir(exist_ok=True, parents=True)
4445
self.compress = compress
4546
self.dpkg_source = shutil.which("dpkg-source")
4647
if not self.dpkg_source:
@@ -89,7 +90,9 @@ def merge(self, p: package.SourcePackage, apply_patches: bool = False) -> Path:
8990
dsc = self.locate_artifact(p, self.dldir)
9091
if not dsc:
9192
raise DscFileNotFoundError(p.dscfile())
92-
merged = dsc.with_suffix(suffix)
93+
dir = self.outdir / dsc.parent.name
94+
dir.mkdir(exist_ok=True)
95+
merged = dir / dsc.with_suffix(suffix).name
9396
if self.compress:
9497
merged = merged.with_suffix(f"{merged.suffix}{self.compress.fileext}")
9598

0 commit comments

Comments
 (0)