Browse Source

Make ebin directory before trying to add it to code path

Sina Samavati 11 years ago
parent
commit
3bcc041153
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/mad_compile.erl

+ 8 - 2
src/mad_compile.erl

@@ -56,9 +56,12 @@ dep(Cwd, Name) ->
         Files ->
             IncDir = mad_utils:include(DepPath),
             EbinDir = mad_utils:ebin(DepPath),
+
+            %% create EbinDir and add it to code path
+            file:make_dir(EbinDir),
             code:add_path(EbinDir),
+
             Opts = mad_utils:get_value(erl_opts, Conf1, []),
-            mad_utils:exec("mkdir", ["-p", EbinDir]),
             lists:foreach(compile_fun(IncDir, EbinDir, Opts), Files),
             put(Name, compiled),
             ok
@@ -76,9 +79,12 @@ app(Dir) ->
         Files ->
             IncDir = mad_utils:include(Dir),
             EbinDir = mad_utils:ebin(Dir),
+
+            %% create EbinDir and add it to code path
+            file:make_dir(EbinDir),
             code:add_path(EbinDir),
+
             Opts = mad_utils:get_value(erl_opts, Conf1, []),
-            mad_utils:exec("mkdir", ["-p", EbinDir]),
             lists:foreach(compile_fun(IncDir, EbinDir, Opts), Files),
             ok
     end.