Commit 75ab0f064591e72e042725838cd970bbfa483fd9

Dominic Letz 2021-10-04T19:55:55

Use x64 binary for mac M1 for now (#12)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/lib/dart_sass.ex b/lib/dart_sass.ex
index 79fc3cc..6cf0de9 100644
--- a/lib/dart_sass.ex
+++ b/lib/dart_sass.ex
@@ -257,6 +257,14 @@ defmodule DartSass do
         [arch | _] = arch_str |> List.to_string() |> String.split("-")
         osname = if osname == :darwin, do: :macos, else: osname
 
+        arch =
+          if osname == :macos and arch == "aarch64" do
+            # Using Rosetta2 for M1 until dart_sass runs native
+            "amd64"
+          else
+            arch
+          end
+
         case arch do
           "amd64" -> "#{osname}-x64.tar.gz"
           "x86_64" -> "#{osname}-x64.tar.gz"