forked from rosa/hakurei
This avoids having to rebuild cmd/mbf over and over. Signed-off-by: Ophestra <cat@gensokyo.uk>
29 lines
427 B
Go
29 lines
427 B
Go
//go:build penv
|
|
|
|
package rosa
|
|
|
|
import (
|
|
"io/fs"
|
|
"os"
|
|
)
|
|
|
|
// builtinAzalea is the backing directory of built-in azalea-based [Artifact]
|
|
// implementations.
|
|
var builtinAzalea = func() fs.FS {
|
|
const name = "ROSA_SOURCE"
|
|
|
|
pathname, ok := os.LookupEnv(name)
|
|
if !ok {
|
|
println(name + " not set")
|
|
os.Exit(1)
|
|
}
|
|
|
|
root, err := os.OpenRoot(pathname)
|
|
if err != nil {
|
|
println(err.Error())
|
|
os.Exit(1)
|
|
}
|
|
|
|
return root.FS()
|
|
}()
|