Set PWD in environment when running the Node apps

E.g. PostCSS and Babel.

This is in line with what we do when running Go.
This commit is contained in:
Bjørn Erik Pedersen 2020-09-14 10:22:24 +02:00
parent 292b0e26ec
commit 377ad87a51
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -87,7 +87,7 @@ func GetExecEnviron(workDir string, cfg config.Provider, fs afero.Fs) []string {
nodepath = workDir + string(os.PathListSeparator) + np
}
config.SetEnvVars(&env, "NODE_PATH", nodepath)
config.SetEnvVars(&env, "HUGO_WORKDIR", workDir)
config.SetEnvVars(&env, "PWD", workDir)
config.SetEnvVars(&env, "HUGO_ENVIRONMENT", cfg.GetString("environment"))
fis, err := afero.ReadDir(fs, files.FolderJSConfig)
if err == nil {