Files
narratio/internal/artifacts/product_path.go
Eric Rakestraw 831665c913
All checks were successful
ci/woodpecker/tag/release Pipeline was successful
Align module path with Narratio v4 release
2026-12-03 02:01:48 +00:00

23 lines
633 B
Go

package artifacts
import (
"path/filepath"
"strings"
"gitea.maximumdirect.net/eric/narratio/v4/internal/pathsafe"
)
// ProductRelativePath derives portable identity without changing configuration.
// Configuration validation separately enforces the product's flat category.
func ProductRelativePath(sessionRoot, configured string) (string, error) {
value := strings.TrimSpace(configured)
if filepath.IsAbs(value) {
root, err := filepath.Abs(sessionRoot)
if err != nil {
return "", err
}
return pathsafe.SlashRelativeFromRoot(root, value)
}
return pathsafe.NormalizeRelativeDestination(filepath.ToSlash(value))
}