Skip to content

Commit bc3fc83

Browse files
authored
Merge pull request #4 from vovimayhem/feature/apple-m1-support
Apple M1 Support
2 parents 3ff15ea + e59b2fb commit bc3fc83

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

exe/aarch64-linux/sass

9.05 MB
Binary file not shown.

exe/arm64-darwin/sass

8.22 MB
Binary file not shown.

exe/dartsass

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@
33

44
require "shellwords"
55

6-
os = Gem::Platform.local.os
6+
platform_info = Gem::Platform.local
7+
platform_string = "#{platform_info.cpu}-#{platform_info.os}"
78

89
exe_path =
9-
case os
10-
when "darwin" then File.join(__dir__, "darwin/sass")
11-
when "linux" then File.join(__dir__, "linux/sass")
12-
when "mingw32" then File.join(__dir__, "mingw32/sass.bat")
10+
case platform_string
11+
when "aarch64-linux" then File.join(__dir__, "aarch64-linux/sass")
12+
when "arm64-darwin" then File.join(__dir__, "arm64-darwin/sass")
13+
when /darwin\z/ then File.join(__dir__, "darwin/sass")
14+
when /linux\z/ then File.join(__dir__, "linux/sass")
15+
when /mingw32\z/ then File.join(__dir__, "mingw32/sass.bat")
1316
else
1417
STDERR.puts(<<~ERRMSG)
15-
ERROR: dartsass-rails does not support the #{os} operating system
18+
ERROR: dartsass-rails does not support the #{platform_string} platform
1619
ERRMSG
1720
exit 1
1821
end

0 commit comments

Comments
 (0)