Skip to content

Commit 886f893

Browse files
committed
install-latest - dont fail install if new tool is different lib
1 parent 7976815 commit 886f893

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

src/clojure/tools/tools/api.clj

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
last)]
7979
(if coord
8080
(let [current (tool/resolve-tool as)]
81-
(if (and current (zero? (ext/compare-versions lib (:coord current) coord master-edn)))
81+
(if (and current (= lib (:lib current)) (zero? (ext/compare-versions lib (:coord current) coord master-edn)))
8282
(println (str as ":") "Skipping, newest installed" (ext/coord-summary lib coord))
8383
(do
8484
(tool/install-tool lib coord as)
@@ -90,13 +90,17 @@
9090
(defn install-latest
9191
"Install the latest version of a tool under a local tool name for later use.
9292
On install, the tool is procured, and persisted with the tool name for later use.
93-
Either :tool or both :lib and :as are required to install a single tool.
94-
If neither is provided, install the newest version of all tools.
93+
94+
If :tool is provided, the latest version of that existing tool is updated.
95+
If :lib and :as are provided, the latest version of that lib will be installed
96+
with that tool name, replacing any existing tool by that name.
97+
If no args are provided, install the newest version of all tools.
9598
9699
The latest version is determined by listing the versions in semver order,
97100
filtering out versions with special strings, and choosing the last one.
98101
Special strings that cause a version to be ignored are:
99102
alpha a beta b miletone m rc cr snapshot
103+
Note that for git deps, the newest tagged version will be installed.
100104
101105
It is recommended that Maven tool releases use Maven release version
102106
conventions, and that git tool releases use tags in the format \"vA.B.C\".
@@ -130,7 +134,11 @@
130134

131135
(comment
132136
(tool/list-tools)
133-
(tool/resolve-tool "deps-new")
137+
138+
(install-latest {:lib 'io.github.seancorfield/clj-new :as 'new})
139+
(install-latest {:lib 'io.github.seancorfield/deps-new :as 'new})
140+
141+
(tool/resolve-tool "new")
134142
(def master-edn
135143
(let [{:keys [root-edn user-edn]} (deps/find-edn-maps)]
136144
(deps/merge-edns [root-edn user-edn])))

0 commit comments

Comments
 (0)