Skip to content

Commit

Permalink
No options needed
Browse files Browse the repository at this point in the history
  • Loading branch information
eval committed Apr 30, 2024
1 parent d1ada0a commit 3c97d10
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/eval/deps_try/deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@

#_:end)

(defmulti resolve-dep (fn [[type] _options] type))
(defmulti resolve-dep (fn [[type]] type))

(defmethod resolve-dep :dep/local [[_ arg _version] _options]
(defmethod resolve-dep :dep/local [[_ arg _version]]
(let [full (fs/canonicalize (fs/expand-home arg))]
(cond
(not (and (fs/exists? full)
Expand All @@ -301,7 +301,7 @@
{:deps [[(symbol dep-name) {:local/root (str full)}]]}))))


(defmethod resolve-dep :dep/git [[_ arg version] _options]
(defmethod resolve-dep :dep/git [[_ arg version]]
(let [[dep-name git-url] (cond
(re-find #"^https?" arg) [(symbol (git-url->dep-name arg)) arg]
:else [(symbol arg) (dep-url->git-url arg)])
Expand All @@ -312,15 +312,15 @@
{:error error})))


(defmethod resolve-dep :dep/mvn [[_ arg version] _options]
(defmethod resolve-dep :dep/mvn [[_ arg version]]
(let [{version :mvn/version error :error} (resolve-version [:dep/mvn arg version])]
(if-not error
{:deps [[(symbol arg) version]]}
{:error error})))

(declare resolve-deps*)

(defmethod resolve-dep :or [[_or & recipes] _options]
(defmethod resolve-dep :or [[_or & recipes]]
(let [results (atom [])
store! #(peek (swap! results conj %))]
;; TODO ensure order in recipes: :dep/mvn, :dep/git, :dep/local
Expand All @@ -343,7 +343,7 @@
stop? #(:error @result)]
(doseq [step recipe
:while (not (stop?))]
(let [{:keys [error deps]} (resolve-dep step {:offline true})]
(let [{:keys [error deps]} (resolve-dep step)]
(if error
(swap! result assoc :error error)
(swap! result update :deps into deps))))
Expand Down

0 comments on commit 3c97d10

Please sign in to comment.