Commit 28316df292cd0f4d0cc6f3f604d75669ad2f8f5a

Thomas de Grivel 2022-04-02T19:37:40

no need for platform() when path is provided.

diff --git a/lib/dart_sass.ex b/lib/dart_sass.ex
index ee6c0bf..5d46001 100644
--- a/lib/dart_sass.ex
+++ b/lib/dart_sass.ex
@@ -120,17 +120,18 @@ defmodule DartSass do
   preceeded by the path to the Dart VM executable.
   """
   def bin_path do
-    platform = platform()
-
-    cond do
-      env_path = Application.get_env(:dart_sass, :path) ->
-        List.wrap(env_path)
-
-      Code.ensure_loaded?(Mix.Project) ->
-        bin_path(platform, Path.dirname(Mix.Project.build_path()))
+    env_path = Application.get_env(:dart_sass, :path)
+    if env_path do
+      List.wrap(env_path)
+    else
+      platform = platform()
+      cond do
+        Code.ensure_loaded?(Mix.Project) ->
+          bin_path(platform, Path.dirname(Mix.Project.build_path()))
 
-      true ->
-        bin_path(platform, "_build")
+        true ->
+          bin_path(platform, "_build")
+      end
     end
   end