This commit is contained in:
aynic.os
2021-05-17 17:20:31 +02:00
parent a40cdb5525
commit 10de1d466e
2 changed files with 6 additions and 11 deletions
+5
View File
@@ -7,9 +7,14 @@
# include .env file
-include .env
env = IFS=$$'\n'; env $(env_reset) $(env_vars) "$(env.dist)" "$(env.file)" sh -c '$(1)'
env.dist = $(shell printenv |awk -F '=' 'NR == FNR { if($$1 !~ /^(\#|$$)/) { A[$$1]; next } } ($$1 in A)' .env.dist - 2>/dev/null)
env.file = $(shell cat $(ENV_FILE) 2>/dev/null |sed '/^[ \t]*$$/d;/^[ \t]*\#/d;')
ifneq (,$(filter true,$(ENV_RESET)))
env_reset := -i
endif
env_vars = $(foreach var,$(ENV_VARS),$(if $($(var)),$(var)='$($(var))'))
SHELL:=/bin/bash