Extract Tailwind release helpers
This commit is contained in:
@@ -8,19 +8,12 @@ defmodule Mix.Tasks.Tailwind.CheckVersion do
|
||||
Exits with 0 if versions match, 1 if the Tailwind needs to be updated.
|
||||
"""
|
||||
|
||||
alias Mix.Tasks.Tailwind.Release
|
||||
|
||||
@impl Mix.Task
|
||||
def run(_args) do
|
||||
Application.ensure_all_started(:req)
|
||||
|
||||
current_version =
|
||||
Application.get_env(:tailwind, :version)
|
||||
|
||||
latest_version_url =
|
||||
"https://api.github.com/repos/tailwindlabs/tailwindcss/releases/latest"
|
||||
|
||||
latest_version =
|
||||
Req.get!(latest_version_url).body["tag_name"]
|
||||
|> String.replace_prefix("v", "")
|
||||
current_version = Release.fetch_current_version()
|
||||
latest_version = Release.fetch_latest_version!()
|
||||
|
||||
if current_version !== latest_version do
|
||||
Mix.Shell.IO.info(
|
||||
|
||||
Reference in New Issue
Block a user