Throw error when not one of version or path
...with qualified symbol pod-spec
This commit is contained in:
parent
77d5f2b219
commit
fd86ecfffa
1 changed files with 5 additions and 0 deletions
|
|
@ -315,6 +315,11 @@
|
||||||
(println (str/join " " (map pr-str strs)))))
|
(println (str/join " " (map pr-str strs)))))
|
||||||
|
|
||||||
(defn resolve-pod [pod-spec {:keys [:version :path :force] :as opts}]
|
(defn resolve-pod [pod-spec {:keys [:version :path :force] :as opts}]
|
||||||
|
(when (qualified-symbol? pod-spec)
|
||||||
|
(when (and (not version) (not path))
|
||||||
|
(throw (IllegalArgumentException. "Version or path must be provided")))
|
||||||
|
(when (and version path)
|
||||||
|
(throw (IllegalArgumentException. "You must provide either version or path, not both"))))
|
||||||
(let [resolved (when (and (qualified-symbol? pod-spec) version)
|
(let [resolved (when (and (qualified-symbol? pod-spec) version)
|
||||||
(resolver/resolve pod-spec version force))
|
(resolver/resolve pod-spec version force))
|
||||||
opts (if resolved
|
opts (if resolved
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue