Add version command line arg

Requires "project.clj" to be added in resource-path
main
bom 3 days ago committed by bom
parent 220aef9d5c
commit 4cbaac8d25

@ -12,7 +12,8 @@
:target-path "target/%s/"
:source-paths ["src/main/cljc"
"src/main/clj"]
:resource-paths ["src/main/resources"]
:resource-paths ["src/main/resources"
"project.clj"]
:repositories [["snapshots" :clojars]
["releases" :clojars]]
:deploy-repositories [["snapshots" {:sign-releases false :url "https://clojars.org/repo"}]

@ -4,6 +4,7 @@
[clojure.spec.alpha :as s]
[clojure.string :as cs]
[clojure.tools.reader.edn :as edn]
[clojure.java.io :as io]
[dda.c4k-common.yaml :as yaml]
[dda.c4k-common.common :as cm]
[dda.c4k-common.core :as core]
@ -15,7 +16,7 @@
" name " {your configuraton file} {your authorization file}"))
(s/def ::options (s/* #{"-h"}))
(s/def ::options (s/* #{"-h" "-v" "--version"}))
(s/def ::filename (s/and string?
#(not (cs/starts-with? % "-"))))
(s/def ::cmd-args (s/cat :options ::options
@ -37,6 +38,8 @@
(cond
(some #(= "-h" %) options)
(println (usage name))
(some #(or (= "-v" %) (= "--version" %)) options)
(println (some-> (io/resource "project.clj") slurp edn/read-string (nth 2)))
:else
(let [config-str (slurp config)
auth-str (slurp auth)

Loading…
Cancel
Save