leiningen

Maris 2023-06-21T14:38:52.833859Z

Is it possible to inject environment variables (from a file) in lein process? I am using Emacs and Cider. At the moment I have to type them manually to alter lein command. C-u M-x cider-jack-in-clj.

Brennan C. 2023-06-21T14:51:10.071729Z

https://github.com/weavejester/environ may be one way of managing that.

Maris 2023-06-21T14:59:56.569539Z

We use lein-environ. I didn’t know it can update env variables.

Brennan C. 2023-06-21T15:18:06.098269Z

It doesn't exactly do that, it provides an interface for reading environmental variables with a set of overrides (which may be good enough for you, I'm not sure what you're trying to do). If you're trying to make sure those env vars are getting passed along to subprocesses that you're kicking off, you'll probably want to set them via https://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html.

Maris 2023-06-21T15:21:52.205549Z

I need to use a different AWS key for some projects. AWS client doesn’t use environ unfortunately.

vemv 2023-06-21T15:34:57.748219Z

I sense that https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html might help up to a point, that way, the bulk of the per-project stuff doesn't have to be dumped into larger files. Activating an aws profile on a per-dir basis should be easy with emacs.

👍 1