From d03da092ea1566cc62dfa7f99d12de0f9f7c4655 Mon Sep 17 00:00:00 2001 From: noarkhh Date: Wed, 17 Apr 2024 16:04:50 +0200 Subject: [PATCH] Stop Bundlex.Output invovations in runtime --- lib/bundlex.ex | 2 +- lib/bundlex/platform.ex | 18 ++++++++---------- mix.exs | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/bundlex.ex b/lib/bundlex.ex index 4bb9344..7ecfed9 100644 --- a/lib/bundlex.ex +++ b/lib/bundlex.ex @@ -78,7 +78,7 @@ defmodule Bundlex do """ @spec family() :: :unix | :windows | :custom def family() do - Platform.family(platform()) + Platform.family(Platform.get_target!()) end @doc """ diff --git a/lib/bundlex/platform.ex b/lib/bundlex/platform.ex index 1c2b235..8bc5dfb 100644 --- a/lib/bundlex/platform.ex +++ b/lib/bundlex/platform.ex @@ -86,18 +86,16 @@ defmodule Bundlex.Platform do end {:ok, _crosscompile} -> - def get_target!() do - case System.fetch_env("NERVES_APP") do - {:ok, _app} -> - :nerves + case System.fetch_env("NERVES_APP") do + {:ok, _app} -> + def get_target!(), do: :nerves - :error -> - Output.info( - "Cross-compiling without using Nerves. Make sure necessary environment variables are set correctly." - ) + :error -> + Output.info( + "Cross-compiling without using Nerves. Make sure necessary environment variables are set correctly." + ) - :custom - end + def get_target!(), do: :custom end end diff --git a/mix.exs b/mix.exs index 40e34e3..1e030d1 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Bundlex.Mixfile do use Mix.Project - @version "1.5.0" + @version "1.5.1" @github_url "https://github.com/membraneframework/bundlex" def project do