main: fix creating output dir for --with-buildlog
Trivial fix for the missing `mkdir()` call when `--with-buildlog` is specified (and the matching test update).
This commit is contained in:
parent
3fd0373bc0
commit
c3ca146161
2 changed files with 5 additions and 2 deletions
|
|
@ -37,10 +37,13 @@ func buildImage(pbar progress.ProgressBar, res *imagefilter.Result, osbuildManif
|
|||
OutputDir: opts.OutputDir,
|
||||
}
|
||||
if opts.WriteBuildlog {
|
||||
if err := os.MkdirAll(opts.OutputDir, 0755); err != nil {
|
||||
return fmt.Errorf("cannot create buildlog base directory: %w", err)
|
||||
}
|
||||
p := filepath.Join(opts.OutputDir, fmt.Sprintf("%s.buildlog", outputNameFor(res)))
|
||||
f, err := os.Create(p)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("cannot create buildlog: %w", err)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ func TestBuildIntegrationArgs(t *testing.T) {
|
|||
},
|
||||
} {
|
||||
t.Run(strings.Join(tc.args, ","), func(t *testing.T) {
|
||||
outputDir := t.TempDir()
|
||||
outputDir := filepath.Join(t.TempDir(), "output")
|
||||
|
||||
cmd := []string{
|
||||
"build",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue