Update ls_jar.clj [skip ci]

This commit is contained in:
Michiel Borkent 2020-07-01 13:53:03 +02:00
parent e667bb5d2f
commit 018e011ee6

View file

@ -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))))