jackrusher / mundaneum

A clojure wrapper around WikiData
BSD Zero Clause License
127 stars 16 forks source link

props-2019-08-18.json not on classpath? #9

Closed den1k closed 4 years ago

den1k commented 4 years ago

Running this in the REPL w/ clojure.tools.deps add-lib support:

(add-lib 
 'mundaneum 
 {:git/url "https://github.com/jackrusher/mundaneum"
  :sha "1038471bb40489e2e03d6d26895243c8970dad3d"})

(require '[mundaneum.query :as mq])

I get the following error:

:cause "resources/props-2019-08-18.json (No such file or directory)"

I think props-2019-08-18.json to mediate this the file would need to be put into a resources folder or added to deps as :paths ["src" "resources"]}

den1k commented 4 years ago

FYI just tried this and it does not work: https://github.com/den1k/mundaneum/commit/1a5e2f7b1b546dcf7ffc44a0b4384bb0d5c555a1

jackrusher commented 4 years ago

Fixed in master. 😊 The trick is to read the file location from the class path using (clojure.java.io/resource "the-file-name") because the path shows up differently depending on whether it's reading from the local filesystem during development or from the JAR during deployment.