Fork me on GitHub
#leiningen
<
2017-03-28
>
bostonaholic17:03:27

I’m using environ for getting env vars from a profiles.clj file while in development (my local machine). But when I run lein run it doesn’t seem to pick up my environment vars declared in profiles.clj

{:dev {:env {:database-url "//localhost:5432/postgresql"
             :database-user "app"
             :database-password "app"}}}

bostonaholic17:03:39

it’s almost like lein run isn’t using the dev profile

bostonaholic17:03:53

anyone have any suggestions?

bostonaholic17:03:38

lein run with-profile dev isn’t working, either

xiongtx17:03:08

You need the lein-environ plugin in addition to the environ dependency

bostonaholic17:03:46

I didn’t think I needed since it says If you want to be able to draw settings from the Leiningen project map

bostonaholic17:03:09

but that did the trick

bostonaholic17:03:41

I’ll ask to update the docs for environ that you need it also for accessing profiles.clj

xiongtx17:03:16

Your profiles.clj gets merged into your project.clj

xiongtx17:03:22

That’s a Leiningen thing

bostonaholic18:03:03

yeah, I knew that. I was just confused by the environ docs cause I wasn’t explicitly pulling from project.clj

bostonaholic18:03:14

it makes sense why, now. but could be more clear in the docs