From 8336a5cd99e4db6229648e624a106d523606a1c8 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Thu, 27 Jun 2024 10:06:18 +0200 Subject: [PATCH] Fix version check for Elixir Prior to this patch, we couldn't use this package because it was crashing when using Elixir pre-releases (here, 1.18.0-dev): == Compilation error in file lib/x509/logger.ex == ** (ArgumentError) errors were found at the given arguments: * 1st argument: not a textual representation of an integer :erlang.binary_to_integer("0-dev") (elixir 1.18.0-dev) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2 (elixir 1.18.0-dev) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2 lib/x509/logger.ex:7: (module) This is now fixed. `X509.Util.app_version/1` is still used in a couple other places but just for applications that ship with OTP and they should not have this problem. --- lib/x509/logger.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/x509/logger.ex b/lib/x509/logger.ex index 110cf40..621a714 100644 --- a/lib/x509/logger.ex +++ b/lib/x509/logger.ex @@ -4,7 +4,7 @@ defmodule X509.Logger do require Logger - if Util.app_version(:logger) >= [1, 11, 0] do + if Version.match?(System.version(), ">= 1.11.0") do def warn(message, metadata \\ []) do Logger.warning(message, metadata) end