Throw error when not one of version or path

...with qualified symbol pod-spec
This commit is contained in:
Wes Morgan 2022-03-23 09:05:30 -06:00
parent 77d5f2b219
commit fd86ecfffa
No known key found for this signature in database
GPG key ID: 5639E4CBFA17DC84

View file

@ -315,6 +315,11 @@
(println (str/join " " (map pr-str strs)))))
(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)
(resolver/resolve pod-spec version force))
opts (if resolved