Add alias to bump TLDs list easily
This commit is contained in:
parent
bd7a759911
commit
2b338e9ace
1 changed files with 15 additions and 0 deletions
15
mix.exs
15
mix.exs
|
@ -10,6 +10,7 @@ defmodule Linkify.Mixfile do
|
|||
elixir: "~> 1.8",
|
||||
build_embedded: Mix.env() == :prod,
|
||||
start_permanent: Mix.env() == :prod,
|
||||
aliases: aliases(),
|
||||
deps: deps(),
|
||||
docs: [extras: ["README.md"]],
|
||||
package: package(),
|
||||
|
@ -41,4 +42,18 @@ defmodule Linkify.Mixfile do
|
|||
files: ~w(lib priv README.md mix.exs LICENSE)
|
||||
]
|
||||
end
|
||||
|
||||
defp aliases do
|
||||
[
|
||||
"update.tlds": &update_tlds/1
|
||||
]
|
||||
end
|
||||
|
||||
defp update_tlds(_) do
|
||||
:os.cmd(
|
||||
String.to_charlist(
|
||||
"curl https://data.iana.org/TLD/tlds-alpha-by-domain.txt | tr '[:upper:]' '[:lower:]' | tail -n +2 > priv/tlds.txt"
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue