From 9c3c518ea420eb8dc2f4a44f4cd5f0c21ba1cd6b Mon Sep 17 00:00:00 2001 From: Vygandas Pliasas Date: Thu, 26 Oct 2023 09:57:32 +0300 Subject: [PATCH] added rule to load .env in Makefile --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index 4335099..219a335 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,14 @@ +#!/usr/bin/make + +# --- Load in .env --- + +ifneq ("$(wildcard .env)","") + include .env + export $(shell sed 's/=.*//' .env) +endif + +# --- Some prep --- + ARGS = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}` DOCKER_RUN_CMD = docker run -it --rm -u $(shell id -u):$(shell id -g) -v ./:/app --workdir="/app" --network="host"