Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Don't check version if path is present #73

Merged
merged 9 commits into from
Aug 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/esbuild.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Esbuild do
# https://registry.npmjs.org/esbuild/latest
@latest_version "0.17.11"
@latest_version "0.23.00"

@moduledoc """
Esbuild is an installer and runner for [esbuild](https://esbuild.github.io).
Expand Down Expand Up @@ -65,7 +65,7 @@ defmodule Esbuild do

@doc false
def start(_, _) do
unless Application.get_env(:esbuild, :version) do
unless Application.get_env(:esbuild, :version) or Application.get_env(:esbuild, :path) do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think or will work here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, fixed

Logger.warning("""
esbuild version is not configured. Please set it in your config files:

Expand Down Expand Up @@ -100,7 +100,10 @@ defmodule Esbuild do
Returns the configured esbuild version.
"""
def configured_version do
Application.get_env(:esbuild, :version, latest_version())
default_version =
if Application.get_env(:esbuild, :path), do: bin_version(), else: latest_version()

Application.get_env(:esbuild, :version, default_version)
end

@doc """
Expand Down