internal/rosa: evaluate packages from fs

This migrates GNU sed to azalea, and resulting IR matches.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-18 17:53:48 +09:00
parent 0360e779f3
commit 37df040d85
5 changed files with 133 additions and 30 deletions

View File

@@ -2,6 +2,9 @@
package rosa
import (
"embed"
"io/fs"
"os"
"path"
"slices"
"strconv"
@@ -608,3 +611,20 @@ var native S
// Native returns the global [S].
func Native() *S { return &native }
// nativeB is the backing directory of built-in azalea-based [Artifact]
// implementations.
//
//go:embed package
var nativeB embed.FS
func init() {
sub, err := fs.Sub(nativeB, "package")
if err != nil {
panic(err)
}
if err = native.EvaluateFS(sub); err != nil {
println(err)
os.Exit(1)
}
}