Resolve output file paths to absolute paths to ensure files are created in the expected location
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2026-03-15 16:38:57 +07:00
commit e4c218d67c

View file

@ -5,6 +5,7 @@ import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)
@ -32,6 +33,15 @@ func Exec(ctx context.Context, args Args) error {
}
for _, o := range args.Output {
// If the output spec contains a file path (FORMAT=FILE), resolve it to an absolute path.
if idx := strings.Index(o, "="); idx >= 0 {
filePath := o[idx+1:]
if !filepath.IsAbs(filePath) {
if wd, err := os.Getwd(); err == nil {
o = o[:idx+1] + filepath.Join(wd, filePath)
}
}
}
cmdArgs = append(cmdArgs, "--output", o)
}