diff --git a/examples/ls_jar.clj b/examples/ls_jar.clj index 4b7d2e54..aac83c7f 100755 --- a/examples/ls_jar.clj +++ b/examples/ls_jar.clj @@ -4,14 +4,16 @@ (require '[clojure.java.io :as io] '[clojure.string :as str]) - -(let [lib (first *command-line-args*) - [_org lib-name] (str/split lib #"/") - version (second *command-line-args*)] +(let [file (if (= 1 (count *command-line-args*)) + (io/file (first *command-line-args*)) + (let [lib (first *command-line-args*) + [_org lib-name] (str/split lib #"/") + version (second *command-line-args*)] + (io/file (System/getProperty "user.home") + (format ".m2/repository/%s/%s/%s-%s.jar" + (str/replace lib "." (System/getProperty "file.separator")) + version + lib-name version))))] (doseq [e (enumeration-seq - (.entries (java.util.jar.JarFile. - (io/file (System/getProperty "user.home") - (format ".m2/repository/%s/%s/%s-%s.jar" - lib version - lib-name version)))))] + (.entries (java.util.jar.JarFile. file)))] (println (.getName e))))