Files
Claudio Ortolina 7cf9b4e7f8 First pass at uniformed types, specs and docs
- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
2026-03-06 08:33:11 +00:00

29 lines
748 B
Elixir

defmodule Mix.Tasks.Esbuild.CheckVersion do
@shortdoc "Checks the current Esbuild version is the latest"
@moduledoc """
Checks the current esbuild version is the latest.
Exits with 0 if versions match, 1 if the esbuild needs to be updated.
"""
use Mix.Task
alias Mix.Tasks.Esbuild.Release
@impl Mix.Task
def run(_args) do
current_version = Release.fetch_current_version()
latest_version = Release.fetch_latest_version!()
if current_version === latest_version do
Mix.Shell.IO.info("The esbuild version is up to date (#{current_version})")
else
Mix.Shell.IO.info(
"A new esbuild version is available: #{current_version} ==> #{latest_version}"
)
System.halt(1)
end
end
end