Add HUGO_ENV to the os/exec environment
authorJoe Mooring <joe.mooring@veriphor.com>
Fri, 11 Feb 2022 00:00:54 +0000 (16:00 -0800)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 11 Feb 2022 07:30:26 +0000 (08:30 +0100)
Closes #9490

common/hugo/hugo.go

index c8db18afee8bb92b30ad8c5b4df029fef4919277..5bbfe7c65386793db06b3814a7b2310bbc1acb3b 100644 (file)
@@ -109,6 +109,7 @@ func GetExecEnviron(workDir string, cfg config.Provider, fs afero.Fs) []string {
        config.SetEnvVars(&env, "NODE_PATH", nodepath)
        config.SetEnvVars(&env, "PWD", workDir)
        config.SetEnvVars(&env, "HUGO_ENVIRONMENT", cfg.GetString("environment"))
+       config.SetEnvVars(&env, "HUGO_ENV", cfg.GetString("environment"))
 
        if fs != nil {
                fis, err := afero.ReadDir(fs, files.FolderJSConfig)