Commit 91e0b94e7ad1215e336db8a60443e19e1ed49f3a

Michael Crumm 2021-08-23T18:11:45

Extract archive with charlist cwd option h/t @michallepicki See https://github.com/phoenixframework/esbuild/pull/15

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/lib/dart_sass.ex b/lib/dart_sass.ex
index 2088d1f..d56083d 100644
--- a/lib/dart_sass.ex
+++ b/lib/dart_sass.ex
@@ -236,11 +236,11 @@ defmodule DartSass do
   end
 
   defp unpack_archive(".zip", zip, cwd) do
-    with {:ok, _} <- :zip.unzip(zip, cwd: cwd), do: :ok
+    with {:ok, _} <- :zip.unzip(zip, cwd: to_charlist(cwd)), do: :ok
   end
 
   defp unpack_archive(_, tar, cwd) do
-    :erl_tar.extract({:binary, tar}, [:compressed, cwd: cwd])
+    :erl_tar.extract({:binary, tar}, [:compressed, cwd: to_charlist(cwd)])
   end
 
   # Available targets: https://github.com/sass/dart-sass/releases