From 0a758570fbcb4f05f9408bb79018d866aaac5054 Mon Sep 17 00:00:00 2001
From: falood <falood@gmail.com>
Date: Tue, 25 Jul 2017 20:18:31 -0700
Subject: [PATCH] bugfix: src_dir not corrent when use file_system as deps

---
 lib/file_system/backends/fs_mac.ex | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lib/file_system/backends/fs_mac.ex b/lib/file_system/backends/fs_mac.ex
index a35324f..7cc4232 100644
--- a/lib/file_system/backends/fs_mac.ex
+++ b/lib/file_system/backends/fs_mac.ex
@@ -30,7 +30,14 @@ defmodule FileSystem.Backends.FSMac do
     exec_file = find_executable()
     unless File.exists?(exec_file) do
       Logger.info "Compiling executable file..."
-      cmd = "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations c_src/mac/*.c -o #{exec_file}"
+      src_dir =
+        case Mix.Project.config[:app] do
+          :file_system ->
+            "."
+          _ ->
+            Mix.Project.deps_paths[:file_system]
+        end
+      cmd = "clang -framework CoreFoundation -framework CoreServices -Wno-deprecated-declarations #{src_dir}/c_src/mac/*.c -o #{exec_file}"
       if Mix.shell.cmd(cmd) > 0 do
         Logger.error "Compile executable file error, try to run `#{cmd}` manually."
         raise "compile backend error"
-- 
GitLab