forked from rosa/hakurei
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user