environ icon indicating copy to clipboard operation
environ copied to clipboard

Read boot-env using io/resource and io/reader

Open larkery opened this issue 6 years ago • 3 comments

Previously used io/file with io/resource, which is not safe when the resource is not a file.

Something like this should work?

larkery avatar Apr 17 '18 14:04 larkery

Thanks for the patch. Can you wrap the commit message at 72 characters and add a reference to the issue being solved, e.g. something like:

Read boot-env using io/resource and io/reader

Using io/file with io/resource is not safe when the resource is not a
file, so would cause uberjars with environ to fail.

Fixes: #80

weavejester avatar Apr 18 '18 17:04 weavejester

I've twiddled the commit a bit to reformat the message and put in a test that .boot-env is read off the classpath as a resource.

larkery avatar Apr 20 '18 16:04 larkery

Thanks! However I think the commit message should make it clear that including .boot-env in a jar is not the intended purpose of the file. So perhaps:

Read boot-env using io/resource and io/reader

Ensures that Environ doesn't crash if .boot-env is accidentally included
in a jar file on the classpath.

Fixes: #80

We don't need to explain exactly how it was fixed, since I think that's self-explanatory for the diff.

Both .boot-env and .lein-env are intended to be temporary files to facilitate the transfer of data from the build script into the running process.

weavejester avatar Apr 20 '18 23:04 weavejester