Created
March 14, 2011 14:56
-
-
Save rik0/869256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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