Fork me on GitHub
#leiningen
<
2020-02-02
>
lmergen15:02:52

yeah, i was looking for a way to do it without editing files so it's a bit more easier to integrate with certain systems... my approach right now is to just do System/getenv from project.clj and that works

mikerod15:02:20

@lmergen you can use lein update-in to only add the key on command line.

mikerod15:02:25

If that helps your cause.

mikerod15:02:37

So it becomes a command oriented thing, not a file edit.

lmergen15:02:53

yeah i saw that, it helps but it's just easier to pass around environment variables

mikerod15:02:09

I think getting and env variable in the project.clj can work nice though.

lmergen15:02:27

i just did :local-repo ~(System/getenv "M2_HOME")

lmergen15:02:36

if it's nil it uses the default

mikerod15:02:11

You can do :local-repo ~local-repo. And you can def that as a var that does whatever logic needed - like an env var read at top of project.clj.

mikerod15:02:25

Sure. That works. If you have no other logic.

mikerod15:02:43

I didn’t know what nil does. But makes sense it’d default. Needs something.

lmergen16:02:27

at least it works as default with the latest version of leiningen / pomegranate

lmergen16:02:40

i might raise an issue / PR with pomegranate, as it looks like i'm certainly not the only one that wants this

lmergen16:02:16

and it sounds like the correct place to fix this