Skip to content

Commit 3e49513

Browse files
committed
Normalize windows driver
1 parent 5f8a6b9 commit 3e49513

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/tailwind.ex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ defmodule Tailwind do
194194
|> add_env_variable_to_ignore_browserslist_outdated_warning()
195195

196196
opts = [
197-
cd: config[:cd] || File.cwd!(),
197+
cd: normalize_windows_driver(config[:cd] || File.cwd!()),
198198
env: env,
199199
into: IO.stream(:stdio, :line),
200200
stderr_to_stdout: true
@@ -205,6 +205,15 @@ defmodule Tailwind do
205205
|> elem(1)
206206
end
207207

208+
defp normalize_windows_driver(path) do
209+
with {:win32, _} <- :os.type(),
210+
<<letter, ?:, rest::binary>> when letter in ?a..?z <- to_string(path) do
211+
<<letter - 32, ?:, rest::binary>>
212+
else
213+
_ -> path
214+
end
215+
end
216+
208217
defp add_env_variable_to_ignore_browserslist_outdated_warning(env) do
209218
Enum.into(env, %{"BROWSERSLIST_IGNORE_OLD_DATA" => "1"})
210219
end

0 commit comments

Comments
 (0)