Skip to content

Instantly share code, notes, and snippets.

@rik0
Created March 14, 2011 14:56
Show Gist options
  • Save rik0/869256 to your computer and use it in GitHub Desktop.
Save rik0/869256 to your computer and use it in GitHub Desktop.
(def *sep* "/")
(def *foo-jar* "foo.jar")
(def *foo-lib* (str-join *sep* ["lib" *foo-jar*]))
(def *where*
["../foo-idea/out/artifacts/foo_jar"])
(defn find-foo [paths]
(if (seq paths)
(let [path (first paths)
full-path (str-join *sep* [path *foo-jar*])]
(if (.exists (file full-path))
full-path
(recur (rest paths))))
nil))
(defn install-foo []
(let [path (find-foo *where*)]
(copy (file path) (file (str-join *sep* ["lib" *foo-jar*])))))
(if (.exists (file *foo-jar*))
(println "Found foo Jar")
(install-foo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment