From bbc9d45beeb7eff49c58142f7b0c56d4c136c331 Mon Sep 17 00:00:00 2001 From: Steffen Deusch Date: Wed, 3 Jun 2026 17:45:11 +0200 Subject: [PATCH] allow lists in env This is the same as https://github.com/phoenixframework/esbuild/pull/78. --- lib/tailwind.ex | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/tailwind.ex b/lib/tailwind.ex index 78e63d7..926c8d3 100644 --- a/lib/tailwind.ex +++ b/lib/tailwind.ex @@ -285,7 +285,7 @@ defmodule Tailwind do opts = [ cd: normalize_windows_driver(config[:cd] || File.cwd!()), - env: env, + env: normalize_env(env), into: IO.stream(:stdio, :line), stderr_to_stdout: true ] @@ -552,4 +552,18 @@ defmodule Tailwind do |> String.replace("$version", version) |> String.replace("$target", target_for_version(version)) end + + defp normalize_env(env) do + Map.new(env, fn + {key, value} when is_list(value) -> {key, Enum.join(value, path_sep())} + other -> other + end) + end + + defp path_sep do + case :os.type() do + {:win32, _} -> ";" + {:unix, _} -> ":" + end + end end