File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 2
2
# because rubygems shims assume a gem's executables are Ruby
3
3
4
4
require "shellwords"
5
+ require "rbconfig"
5
6
6
- platform_info = Gem :: Platform . local
7
- platform_string = "#{ platform_info . cpu } -#{ platform_info . os } "
7
+ system_config = RbConfig :: CONFIG
8
+ platform_string = "#{ system_config [ "host_cpu" ] } -#{ system_config [ "host_os" ] } "
8
9
9
- exe_path =
10
+ exe_path =
10
11
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" )
12
+ when / aarch64-linux/ then File . join ( __dir__ , "aarch64-linux/sass" )
13
+ when / arm64-darwin/ then File . join ( __dir__ , "arm64-darwin/sass" )
14
+ when /darwin/ then File . join ( __dir__ , "darwin/sass" )
15
+ when /linux/ then File . join ( __dir__ , "linux/sass" )
16
+ when /mswin|mingw|cygwin / then File . join ( __dir__ , "mingw32/sass.bat" )
16
17
else
17
18
STDERR . puts ( <<~ERRMSG )
18
19
ERROR: dartsass-rails does not support the #{ platform_string } platform
You can’t perform that action at this time.
0 commit comments