From 8e17f033bc6bd7b5e0bf0dd3336affd87844a79f Mon Sep 17 00:00:00 2001 From: Lakshan Perera Date: Tue, 7 Jan 2025 10:50:46 +1100 Subject: [PATCH] fix: pass NPM_CONFIG_REGISTRY env variable when bundling functions --- internal/functions/deploy/bundle.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/functions/deploy/bundle.go b/internal/functions/deploy/bundle.go index 0119a559c..02f31863f 100644 --- a/internal/functions/deploy/bundle.go +++ b/internal/functions/deploy/bundle.go @@ -57,12 +57,16 @@ func (b *dockerBundler) Bundle(ctx context.Context, entrypoint string, importMap if viper.GetBool("DEBUG") { cmd = append(cmd, "--verbose") } + env := []string{} + if custom_registry := os.Getenv("NPM_CONFIG_REGISTRY"); custom_registry != "" { + env = append(env, "NPM_CONFIG_REGISTRY="+custom_registry) + } // Run bundle if err := utils.DockerRunOnceWithConfig( ctx, container.Config{ Image: utils.Config.EdgeRuntime.Image, - Env: []string{}, + Env: env, Cmd: cmd, WorkingDir: utils.ToDockerPath(cwd), },