This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env make | |
ENV_FILE:=./.env$(if $(FOO),_$(FOO),) | |
ifneq (,$(wildcard ${ENV_FILE})) | |
include ${ENV_FILE} | |
VARS:=$(shell sed -ne 's/ *\#.*$$//; /./ s/=.*$$// p' .env ) | |
$(foreach v,$(VARS),$(eval $(shell echo export $(v)="$(shell echo $($(v)) | sed "s/^'//")"))) | |
else | |
$(error Environment file '${ENV_FILE}' not found) |