debian-forge-cli/cmd/image-builder/build.go
Michael Vogt cc2d1ac692 main: add --output-dir option
This commit adds a new `--output-dir` option to override the
default output directory for the generated artifacts.

Note that this can also be used together with `manifest` when
extra artifacts (like the sbom) is requested.
2025-01-19 21:57:14 +00:00

19 lines
585 B
Go

package main
import (
"github.com/osbuild/images/pkg/imagefilter"
"github.com/osbuild/images/pkg/osbuild"
)
func buildImage(res *imagefilter.Result, osbuildManifest []byte, osbuildStoreDir, outputDir string) error {
// XXX: support output filename via commandline (c.f.
// https://github.com/osbuild/images/pull/1039)
if outputDir == "" {
outputDir = outputDirFor(res)
}
// XXX: support stremaing via images/pkg/osbuild/monitor.go
_, err := osbuild.RunOSBuild(osbuildManifest, osbuildStoreDir, outputDir, res.ImgType.Exports(), nil, nil, false, osStderr)
return err
}