1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Determine The Latest Release Of A Hex Package as an elixir til

This commit is contained in:
jbranchaud
2016-09-23 14:09:01 -05:00
parent d20655524f
commit 500357f58e
2 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
# Determine The Latest Release Of A Hex Package
I will often pop open the browser and do a Google search in order to figure
out the latest release of a package when adding it to my dependencies.
However, lately I've been getting in the habit of using a quicker approach.
The `mix` CLI has a way of looking up info about a package and we don't have
to leave the terminal to use it.
For instance, if I need to determine the latest version of the `postgrex`
package, I can run the following command.
```bash
$ mix hex.info postgrex
PostgreSQL driver for Elixir.
Config: {:postgrex, "~> 0.12.0"}
Releases: 0.12.0, 0.11.2, 0.11.1, 0.11.0, 0.10.0, 0.9.1, 0.9.0, 0.8.4, 0.8.3, 0.8.2, ...
Maintainers: Eric Meadows-Jönsson, James Fish
Licenses: Apache 2.0
Links:
Github: https://github.com/elixir-ecto/postgrex
```
The third line gives me the info I need (`{:postgrex, "~> 0.12.0"}`) and it
is already formatted as a tuple that I can paste right into my `mix.exs`
file.