|
78 | 78 | last)] |
79 | 79 | (if coord |
80 | 80 | (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))) |
82 | 82 | (println (str as ":") "Skipping, newest installed" (ext/coord-summary lib coord)) |
83 | 83 | (do |
84 | 84 | (tool/install-tool lib coord as) |
|
90 | 90 | (defn install-latest |
91 | 91 | "Install the latest version of a tool under a local tool name for later use. |
92 | 92 | 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. |
95 | 98 |
|
96 | 99 | The latest version is determined by listing the versions in semver order, |
97 | 100 | filtering out versions with special strings, and choosing the last one. |
98 | 101 | Special strings that cause a version to be ignored are: |
99 | 102 | alpha a beta b miletone m rc cr snapshot |
| 103 | + Note that for git deps, the newest tagged version will be installed. |
100 | 104 |
|
101 | 105 | It is recommended that Maven tool releases use Maven release version |
102 | 106 | conventions, and that git tool releases use tags in the format \"vA.B.C\". |
|
130 | 134 |
|
131 | 135 | (comment |
132 | 136 | (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") |
134 | 142 | (def master-edn |
135 | 143 | (let [{:keys [root-edn user-edn]} (deps/find-edn-maps)] |
136 | 144 | (deps/merge-edns [root-edn user-edn]))) |
|
0 commit comments