aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/builtins_env.go
blob: a125e25fc9a2a0b73d3684ccc5d491fef26b53eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//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()
}()