commands: Use HUGO_ENV if set

Fixes #6456
This commit is contained in:
Bjørn Erik Pedersen 2019-11-25 19:08:35 +01:00
parent d6f7a9e28d
commit 5c5231e09e
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F

View file

@ -248,6 +248,11 @@ func (cc *hugoBuilderCommon) getEnvironment(isServer bool) string {
return v
}
// Used by Netlify and Forestry
if v, found := os.LookupEnv("HUGO_ENV"); found {
return v
}
if isServer {
return hugo.EnvironmentDevelopment
}