Resolve prebuilt assets from the selected module

This commit is contained in:
2026-10-10 14:08:11 +00:00
parent f059fef320
commit d44ff1260d
8 changed files with 135 additions and 26 deletions

View File

@@ -3,11 +3,24 @@ package artifact
import (
"fmt"
"path/filepath"
"strings"
)
const ManifestFilename = "SHA256SUMS"
// OutputDirectory resolves build output and prebuilt asset directories from
// the absolute selected module directory.
func OutputDirectory(moduleDir, directory string) string {
if directory == "" {
directory = "dist"
}
if !filepath.IsAbs(directory) {
directory = filepath.Join(moduleDir, directory)
}
return filepath.Clean(directory)
}
type Target struct {
OS string
Arch string