diff --git a/internal/execenv/execenv.go b/internal/execenv/execenv.go index bda7fed..eeb8bcf 100644 --- a/internal/execenv/execenv.go +++ b/internal/execenv/execenv.go @@ -17,7 +17,7 @@ const execEnvCallbackName = "exec-env" func Generate(plugin plugins.Plugin, callbackEnv map[string]string) (env map[string]string, err error) { execEnvPath, err := plugin.CallbackPath(execEnvCallbackName) if err != nil { - return env, err + return callbackEnv, err } var stdout strings.Builder @@ -27,7 +27,7 @@ func Generate(plugin plugins.Plugin, callbackEnv map[string]string) (env map[str // executing the callback isn't enough. We actually need to source it (.) so // the environment variables get set, and then run `env` so they get printed // to STDOUT. - expression := execute.NewExpression(fmt.Sprintf(". %s; env", execEnvPath), []string{}) + expression := execute.NewExpression(fmt.Sprintf(". \"%s\"; env", execEnvPath), []string{}) expression.Env = callbackEnv expression.Stdout = &stdout err = expression.Run()