Closed jeroenvandijk closed 5 years ago
Good catch, I totally forgot this might cause an issue. The thing is that shell completions are delegated to existing shells by calling wrapper scripts. So we need to bundle these into the uberjar as well and then somehow read them as resources.
Ah cool. You can read files from the uberjar when you put things in resources
(would have to test with boot-clj) and using (slurp (clojure.java.io/resource "path-in-resources-dir"))
Ok this removes the problem:
$ pwd |> ((fn [x] (setenv "CLOSH_SOURCES_PATH" (first x))))
For a permanent solution, we could have an installation step that copies the resource dir from the uberjar to the directory where the jar is located. I've tested this approach [1] and that would work in combination with clojure.java.io/resource
and slurp
etc
What do you think makes most sense?
[1] https://stackoverflow.com/questions/22363010/get-list-of-embedded-resources-in-uberjar
That PR is a good start to kick things off. I think with it it should be possible just to pass those scripts from resources into respective shells via stdin (without the need to save the contents anywhere to disk).
Using the new uberjar
When I type "(if" and subsequenty press I get the exception below. CTR-c get's me out of this error state again