From 2b7417e6281e69b198e931efbb4f25880a8f8a17 Mon Sep 17 00:00:00 2001 From: Gigitsu Date: Tue, 23 Jul 2024 11:25:42 +0200 Subject: [PATCH] Don't check version if path is present --- config/config.exs | 2 +- lib/tailwind.ex | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/config.exs b/config/config.exs index f08872c..7168f73 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,7 +1,7 @@ import Config config :tailwind, - version: "3.2.7", + version: "3.4.6", another: [ args: ["--help"] ] diff --git a/lib/tailwind.ex b/lib/tailwind.ex index db12eab..e3e8332 100644 --- a/lib/tailwind.ex +++ b/lib/tailwind.ex @@ -1,6 +1,6 @@ defmodule Tailwind do # https://github.com/tailwindlabs/tailwindcss/releases - @latest_version "3.2.7" + @latest_version "3.4.6" @moduledoc """ Tailwind is an installer and runner for [tailwind](https://tailwindcss.com/). @@ -68,7 +68,7 @@ defmodule Tailwind do @doc false def start(_, _) do - unless Application.get_env(:tailwind, :version) do + unless Application.get_env(:tailwind, :version) or Application.get_env(:tailwind, :path) do Logger.warning(""" tailwind version is not configured. Please set it in your config files: @@ -103,7 +103,10 @@ defmodule Tailwind do Returns the configured tailwind version. """ def configured_version do - Application.get_env(:tailwind, :version, latest_version()) + default_version = + if Application.get_env(:tailwind, :path), do: bin_version(), else: latest_version() + + Application.get_env(:tailwind, :version, default_version) end @doc """