diff --git a/neil b/neil index 27a522b..2cee717 100755 --- a/neil +++ b/neil @@ -1236,10 +1236,12 @@ chmod +x bin/kaocha [v :mvn]) (when-let [v (latest-mvn-version lib)] [v :mvn]))) + _ (when-not version + (throw (ex-info (str "Couldn't find version for lib: " lib) {:babashka/exit 0}))) missing? (nil? version) - mvn? (= coord-type? :mvn) - git-sha? (= coord-type? :git/sha) - git-tag? (= coord-type? :git/tag) + mvn? (= :mvn coord-type?) + git-sha? (= :git/sha coord-type?) + git-tag? (= :git/tag coord-type?) git-url (when (or git-sha? git-tag?) (or (:git/url opts) (str "https://github.com/" (git/clean-github-lib lib)))) diff --git a/src/babashka/neil.clj b/src/babashka/neil.clj index 2595d63..7018d2f 100644 --- a/src/babashka/neil.clj +++ b/src/babashka/neil.clj @@ -378,10 +378,12 @@ chmod +x bin/kaocha [v :mvn]) (when-let [v (latest-mvn-version lib)] [v :mvn]))) + _ (when-not version + (throw (ex-info (str "Couldn't find version for lib: " lib) {:babashka/exit 0}))) missing? (nil? version) - mvn? (= coord-type? :mvn) - git-sha? (= coord-type? :git/sha) - git-tag? (= coord-type? :git/tag) + mvn? (= :mvn coord-type?) + git-sha? (= :git/sha coord-type?) + git-tag? (= :git/tag coord-type?) git-url (when (or git-sha? git-tag?) (or (:git/url opts) (str "https://github.com/" (git/clean-github-lib lib)))) diff --git a/tests.clj b/tests.clj index f83be44..649ca18 100644 --- a/tests.clj +++ b/tests.clj @@ -25,7 +25,8 @@ (let [{:keys [edn]} (neil "add dep clj-kondo/clj-kondo")] (is (-> edn :deps (get 'clj-kondo/clj-kondo)))) (let [{:keys [edn]} (neil "add dep clj-kondo")] - (is (-> edn :deps (get 'clj-kondo/clj-kondo))))) + (is (-> edn :deps (get 'clj-kondo/clj-kondo)))) + (is (thrown? Exception (neil "add dep fake-dep")))) (deftest add-dep-alias-test (let [{:keys [edn]} (neil "add dep clj-kondo/clj-kondo" :alias :lint)]