From 81a87b1f8624402f23802f4a331817de0ef7ce47 Mon Sep 17 00:00:00 2001 From: Zemuldo Date: Tue, 13 Aug 2024 13:20:20 +0300 Subject: [PATCH] make crc 32 optional --- mix.exs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mix.exs b/mix.exs index 55181ff..2e2b0d7 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule ExSecrets.MixProject do def project do [ app: :ex_secrets, - version: "0.3.3", + version: "0.3.4", elixir: "~> 1.13", build_embedded: Mix.env() == :prod, start_permanent: Mix.env() == :prod, @@ -31,7 +31,6 @@ defmodule ExSecrets.MixProject do {:httpoison, "~> 1.8"}, {:poison, "~> 3.1"}, {:joken, "~> 2.6"}, - {:crc32cer, "~> 0.1.10"}, # Testing and Documentation {:mix_test_watch, "~> 1.0", only: [:dev, :test], runtime: false}, @@ -44,6 +43,17 @@ defmodule ExSecrets.MixProject do {:excoveralls, "~> 0.10", only: :test}, {:credo, "~> 1.6", only: [:dev, :test], runtime: false} ] + |> require_crc_32() + end + + defp require_crc_32(current_deps) do + case Application.get_env(:ex_secrets, :providers) do + %{"google_secret_manager" => _} -> + current_deps ++ [{:crc32cer, "~> 0.1.10"}] + + _ -> + current_deps + end end defp description() do