meli icon indicating copy to clipboard operation
meli copied to clipboard

add .env support

Open glensc opened this issue 7 years ago • 4 comments

Looks like meli doesn't support .env file.

➔ cat .env
APP_VERSION=1

➔ cat docker-compose.yml
version: "3"

services:
  app:
    image: nginx:${APP_VERSION}

➔ meli -up

	 service=app error=originalErr:: invalid reference format
ThisErr::  :unable to pull image nginx:${APP_VERSION}➔

ps: there's \n missing from error, my bash prompt does not start on new line due that

glensc avatar Feb 27 '18 08:02 glensc

hi @glensc

currently meli only contains the subset of feature that I use daily. I normally don't use .env files in my compose files.

But it looks like you do use, so I'll try and add them; I'll ping you on this issue if/when I do manage to add that feature.

komuw avatar Feb 27 '18 16:02 komuw

@glensc hi, I'm trying to be super minimal with the things that I add to meli. Which is to say, I do not want to add features unless I know they are super critical for someone; so, are .env files super critical to you or a nice to have feature? thanks.

komuw avatar Mar 05 '18 16:03 komuw

i'm not using this tool. but if i would, the .env loading is blocker and i can't use for all purposes without other modifications :)

glensc avatar Mar 06 '18 15:03 glensc

commentary(mostly to self);

  • we could read all .env files
  • parse env vars from them , https://github.com/komuw/meli/blob/fead852172e5f6a25104e92c56a33cdc5806a71d/parsedotenv.go#L32
  • read compose file into a sting and call os.expandEnv on it + the parsed envs akin to; https://github.com/komuw/meli/blob/fead852172e5f6a25104e92c56a33cdc5806a71d/format.go#L66

komuw avatar Apr 28 '18 07:04 komuw