edouard-lopez / devcontainer-features

dev container features
https://containers.dev
MIT License
1 stars 1 forks source link

Add dotenv feature #5

Open edouard-lopez opened 1 year ago

edouard-lopez commented 1 year ago
project requirement last updated tests
motdotla/dotenv nodeJS Dec 22, 2022 :heavy_check_mark:
https://github.com/madcoda/dotenv-shell sh Dec 30, 2020 :heavy_check_mark:
theskumar/python-dotenv python Jan 21, 2023 :heavy_check_mark:
https://github.com/bashup/dotenv bash Sep 18, 2019

Criteria

  1. Minimal dependencies as we want to run in a wide range of containers (sh is best, language specific is worse)
  2. Test to ensure quality and evolution (test+CI is best)
  3. Maintained (exit and pull request are merged is best, so we can fix things)
edouard-lopez commented 1 year ago

Make-native solution

#!/usr/bin/env make

include .env
export # give access to variables from .env in task

show:
    [ ! -e .env ] && touch .env || true # for CI
    echo $${VAR_FROM_SHELL}