Files
phosphoricons/lib/mix/tasks/heroicons/update.ex

35 lines
675 B
Elixir
Raw Normal View History

2022-09-01 14:56:28 +01:00
defmodule Mix.Tasks.Heroicons.Update do
@moduledoc """
Update heroicons.
2022-09-02 13:49:03 -04:00
By default, it downloads the latest version but you can configure it
in your config files.
Example:
2022-09-01 14:56:28 +01:00
config :heroicons, :version, "#{Heroicons.latest_version()}"
2022-09-02 13:49:03 -04:00
Then update with
$ mix heroicons.update
2022-09-01 14:56:28 +01:00
"""
@shortdoc "Update heroicons assets"
use Mix.Task
@impl true
def run(args) do
{_opts, args} = OptionParser.parse!(args, strict: [])
case args do
2022-09-02 06:18:04 -04:00
[] ->
Heroicons.update()
Mix.Task.run("deps.compile", [:heroicons, "--force"])
_ ->
Mix.raise("Invalid arguments, expected: mix heroicons.update")
2022-09-01 14:56:28 +01:00
end
end
end