aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-18 17:53:48 +0900
committerOphestra <cat@gensokyo.uk>2026-05-18 17:54:01 +0900
commit37df040d85e06100c69c6aa3560b2e4ebf977255 (patch)
treec82f47e38a8e53e4b285e4c6c5611dba578d834b /internal/rosa/rosa.go
parent0360e779f3fb9dc770e1f33420ca5b8f8f638666 (diff)
internal/rosa: evaluate packages from fs
This migrates GNU sed to azalea, and resulting IR matches. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index 709b8420..d1a6c25e 100644
--- a/internal/rosa/rosa.go
+++ b/internal/rosa/rosa.go
@@ -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)
+ }
+}