From 5c5231e09e20953dc262df7d3b351a35f1c4b058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 25 Nov 2019 19:08:35 +0100 Subject: [PATCH] commands: Use HUGO_ENV if set Fixes #6456 --- commands/commands.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands/commands.go b/commands/commands.go index 1b09a12a3..2187f7aab 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -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 }