INNER CODE UNIT · Go
run
werf/nelm · scripts/embed-deno/main.go:21
func run() error {
embedRoot := os.Getenv("DENO_EMBED_ROOT")
if embedRoot == "" {
embedRoot = filepath.Join("pkg", "ts", "embed")
}
platform := os.Getenv("DENO_EMBED_PLATFORM")
if platform == "" {
return fmt.Errorf("DENO_EMBED_PLATFORM is required: want <os>/<arch>")
}
goos, goarch, found := strings.Cut(platform, "/")
if !found {
return fmt.Errorf("parse DENO_EMBED_PLATFORM %q: want <os>/<arch>", platform)
}
if _, err := denolock.Get(goos, goarch); err != nil {
return fmt.Errorf("unsupported DENO_EMBED_PLATFORM %q: %w", platform, err)