Skip to content

Commit 9502dc7

Browse files
committed
Better error on missing -Sdeps file
1 parent 591130c commit 9502dc7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Changelog
33

44
*Also see [Tools and installer changelog](https://github.com/clojure/brew-install/blob/1.12.0/CHANGELOG.md)*
55

6+
* next on Mar 5, 2025
7+
* Better error on missing -Sdeps file
68
* 0.22.1503 on Mar 5, 2025
79
* Error on missing -Sdeps file
810
* 0.22.1497 on Mar 5, 2025

Diff for: src/main/clojure/clojure/tools/deps/script/make_classpath2.clj

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
skip-cp threads trace tree] :as _opts}]
8585
(when (and main-aliases exec-aliases)
8686
(throw (ex-info "-M and -X cannot be used at the same time" {})))
87+
(when (and (string? config-data) (not (.exists (jio/file config-data))))
88+
(throw (ex-info (str "Extra deps file not found: " config-data) {})))
8789
(let [combined-exec-aliases (concat main-aliases exec-aliases repl-aliases tool-aliases)
8890
args (cond-> nil
8991
threads (assoc :threads (Long/parseLong threads))

Diff for: src/main/clojure/clojure/tools/deps/script/parse.clj

+1-3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,4 @@
4343
(cond
4444
(s/blank? s) (throw (ex-info (str "-Sdeps must be non-blank") {}))
4545
(s/starts-with? (s/trim s) "{") (edn/read-string {:default tagged-literal} s)
46-
:else (if (.exists (jio/file s))
47-
s
48-
(throw (ex-info (str "Extra deps file not found: " s) {}))))))
46+
:else s)))

Diff for: src/test/clojure/clojure/tools/deps/script/test_parse.clj

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55

66
(deftest test-parse-config
77
(is (= {:paths ["x"]} (parse/parse-config "{:paths [\"x\"]}")))
8-
(is (= "deps.edn" (parse/parse-config "deps.edn")))
9-
(is (thrown? clojure.lang.ExceptionInfo (parse/parse-config "BOGUS"))))
8+
(is (= "deps.edn" (parse/parse-config "deps.edn"))))

0 commit comments

Comments
 (0)