]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #4249 from wallabag/fix/env-not-well-defined
authorJérémy Benoist <j0k3r@users.noreply.github.com>
Tue, 14 Jan 2020 13:30:17 +0000 (14:30 +0100)
committerGitHub <noreply@github.com>
Tue, 14 Jan 2020 13:30:17 +0000 (14:30 +0100)
Ensure ENV is well defined when using make

GNUmakefile

index 865b35e8bd88f8342b510a2026cc2fe924f4e6f6..837f7103fd94cdeb6d0ae880384d680aa8c2fb2d 100755 (executable)
@@ -2,7 +2,14 @@ SHELL=bash
 TMP_FOLDER=/tmp
 RELEASE_FOLDER=wllbg-release
 
-ENV ?= prod
+# ensure the ENV variable is well defined
+AVAILABLE_ENV := prod dev test
+ifneq ($(filter $(ENV),$(AVAILABLE_ENV)),)
+       # all good
+else
+       # not good, force it to "prod"
+       override ENV = prod
+endif
 
 help: ## Display this help menu
        @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'