Browse Source

extract static

Namdak Tonpa 6 years ago
parent
commit
32c1e5075b
3 changed files with 8 additions and 2 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 7 1
      src/provision/mad_repl.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"5bbb57").
+-define(VERSION,"e02149").

BIN
mad


+ 7 - 1
src/provision/mad_repl.erl

@@ -160,7 +160,13 @@ unfold_zips(Bin) ->
     {ok,Unzip} = zip:unzip(Bin,[memory]),
     {ok,Unzip} = zip:unzip(Bin,[memory]),
     [ begin
     [ begin
        try
        try
-        ets:insert(filesystem,{unicode:characters_to_list(base64:decode(list_to_binary(U))),FileBin})
+          Path = binary_to_list(base64:decode(list_to_binary(U))),
+          ets:insert(filesystem,{unicode:characters_to_list(Path),FileBin}),
+        case Path of
+             "priv/"++_ -> filelib:ensure_dir(filename:dirname(Path)),
+                           file:write_file(Path,FileBin);
+             _ -> ok
+         end
        catch _:_ ->
        catch _:_ ->
         ets:insert(filesystem,{U,FileBin})
         ets:insert(filesystem,{U,FileBin})
        end,
        end,