Maxim Sokhatsky 10 years ago
parent
commit
f4a659d107
1 changed files with 18 additions and 0 deletions
  1. 18 0
      src/mad_create.erl

+ 18 - 0
src/mad_create.erl

@@ -0,0 +1,18 @@
+-module(mad_create).
+-copyright('Maxim Sokhatsky').
+-compile(export_all).
+
+app([]) -> app(["sample"]);
+app(Params) ->
+    [Name] = Params,
+    mad_repl:load(),
+    Apps = ets:tab2list(filesystem),
+    [ case string:str(File,"priv/web") of
+       1 -> Relative = Name ++ string:substr(File, 9),
+            io:format("Create File: ~p~n",[Relative]),
+            filelib:ensure_dir(Relative),
+            file:write_file(Relative,Bin);
+       _ -> skip
+       end || {File,Bin} <-Apps].
+
+lib(Params) -> ok.