diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-11-06 05:55:32 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-11-06 05:57:09 +0000 |
| commit | 5be83254486bef58f85f43dba719b674f0c3bc92 (patch) | |
| tree | 519608d655497a60e47202504aaed6bd98655717 /render.moon | |
| parent | mmm.component fix (diff) | |
| download | mmm-5be83254486bef58f85f43dba719b674f0c3bc92.tar.gz mmm-5be83254486bef58f85f43dba719b674f0c3bc92.zip | |
implement mmmfs on real fs
Diffstat (limited to 'render.moon')
| -rw-r--r-- | render.moon | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/render.moon b/render.moon index 90b85d3..b53708b 100644 --- a/render.moon +++ b/render.moon @@ -1,23 +1,17 @@ package.moonpath = './?.server.moon;./?/init.server.moon;' .. package.moonpath -import flush from require 'mmm.init' +require 'mmm.init' import render from require 'mmm.mmmfs' +import load_fileder from require 'mmm.mmmfs.fs' -- usage: --- moon render.moon <output> <fileder_path> [<prefix module> <prefix path>] -{ output_name, path, prefix_mod, prefix_path } = arg +-- moon render.moon <output> <fileder_path> +{ output_name, path } = arg assert output_name, "please specify the output filename as an argument" assert path, "please specify the path name to build as an argument" -root = if prefix_mod and prefix_path - -- prefix module and path are given, skip deeper into the tree - assert path\match '^' .. prefix_path - with require prefix_mod - \mount prefix_path, true -else - -- load full tree - with require 'root' - \mount! +root = load_fileder 'root' .. path +root\mount path content, rehydrate = render root, path assert content, "no content" @@ -48,7 +42,7 @@ with io.open output_name, 'w' <script type=\"application/lua\" src=\"/root.bundle.lua\"></script> <script defer type=\"application/lua\" src=\"/mmm/init.lua\"></script> - #{rehydrate} + #{'' or rehydrate} </body> </html>" \close! |
