leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
2020-02-02T15:17:52.054600Z

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

2020-02-02T15:57:20.055800Z

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

2020-02-02T15:57:25.056Z

If that helps your cause.

2020-02-02T15:57:37.056700Z

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

2020-02-02T15:57:53.057200Z

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

2020-02-02T15:58:09.057800Z

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

2020-02-02T15:58:27.058400Z

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

2020-02-02T15:58:36.058700Z

if it's nil it uses the default

2020-02-02T15:59:11.060Z

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.

2020-02-02T15:59:25.060600Z

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

2020-02-02T15:59:25.060700Z

yup

2020-02-02T15:59:43.061800Z

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

2020-02-02T16:00:27.062500Z

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

2020-02-02T16:01:40.063200Z

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

2020-02-02T16:02:16.064Z

and it sounds like the correct place to fix this

👍 1