Open larkery opened 6 years ago
I have had a quick look at the source - I think this line may not be correct.
If I eval something like (io/file (io/resource "META-INF/MANIFEST.MF"))
in a clojure repl I get the same form of exception. I think that passing (io/resource ".boot-env")
to read-env-file
which then passes it to io/file
cannot work when io/resource
returns a resource from within a jar file. This may have worked in some circumstances where the classpath contains the resource as a file rather than as an entry in a jar.
I think if you use io/reader
instead of io/file
it will work as slurp
should work on reader
and reader
is polymorphic for both input types.
It looks like this is caused by .boot-env
being erroneously included in the jar file, which may be why this hasn't been reported before. In any case, Environ is behaving incorrectly.
Oh right, I thought the intention was that .boot-env would be read from the jar file (so you'd ship the defaults baked into the jar but then replace them with env vars or whatever). I will fix my pull request in a sec.
I haven't been able to get boot-environ working with a simple uberjar. Attached is a minimal example of what happens:
environ-bug.zip
If I run this with
I get an exception
Whereas I expect it to print "spork" and exit.