summaryrefslogtreecommitdiffstats
path: root/pkgs/servers/web-apps/discourse/sass_embedded_vendored_dart_sass.patch
blob: 8d7f55794fa42542cef292925b7124e3c10816da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
diff --git a/ext/sass/Rakefile b/ext/sass/Rakefile
index d542efd..93f97cf 100644
--- a/ext/sass/Rakefile
+++ b/ext/sass/Rakefile
@@ -84,11 +84,18 @@ file File.absolute_path('node_modules/sass', ARCHDIR) do
 end
 
 task 'dart-sass' => (
-  begin
-    SassConfig.dart_sass
-    File.absolute_path('dart-sass/sass', ARCHDIR)
-  rescue NotImplementedError
-    File.absolute_path('node_modules/sass', ARCHDIR)
+  p ENV
+  if ENV.has_key?('DART_SASS_VENDORED')
+    mkdir_p ARCHDIR
+    cp_r ENV.fetch('DART_SASS_VENDORED'), File.absolute_path('dart-sass', ARCHDIR)
+  else
+    raise Errno::EINVAL, "no vendored SASS"
+    begin
+      SassConfig.dart_sass
+      File.absolute_path('dart-sass/sass', ARCHDIR)
+    rescue NotImplementedError
+      File.absolute_path('node_modules/sass', ARCHDIR)
+    end
   end
 )