Welcome! Please see the About page for a little more info on how this works.

+2 votes
in tools.deps by
edited by

When using local/root provider in tools.deps, it would be nice if you could reference your user.home. I share a user level config between machines which have different home location, but my dependencies are all relative to it.

Specifically, this is with my use of REBL, I have the Jar in my home dir, but different home dirs on different of my computers, and would like to not have to customize the deps.edn for each one.

Thank You.

1 Answer

+1 vote
by

Until now we've resisted adding any variables or interpretation to deps.edn so that it can be just plain data. While I wouldn't rule it out, that's a big tradeoff.

by
Perhaps a suggested alternative might be to write whatever code one wants to write a deps.edn file for each installation, and that code would look up the value of $HOME or user.home and put it into the desired places of the generated data?
by
Ya I respect that. I'll wait for the hammock time.
by
@Andy Hum... I could do that, but then my installation process is more than just git pull. And if I change something, I can't just git push, I have to modify the installer script and push that. It gets hairy.

For now, I might be able to get away with using https://github.com/gfredericks/user.clj/blob/master/README.md and actually importing REBL using pomegranate dynamically at runtime.
by
Note that local/root also supports relative paths.
by
What is it relative too though? The deps.edn file? The working dir of the shell executing clj ?
by
The directory containing the "project" deps.edn file. If it's in the ~/.clojure/deps.edn file then it's also relative to the project deps.edn, not to ~/.clojure/deps.edn, which means relative dirs in anything other than the project deps.edn is inherently a little weird.
...