Login
7 branches 0 tags
Ben (X220/Parabola) Moved a lot of stdlib functions over to use bytecode 7b75162 3 years ago 533 Commits
nujel / tools / buildwasm-filesystem.nuj
#!/usr/bin/env nujel

[def directories '["binlib" "stdlib" "tests" "tools"]]
[def output-file "web/filesystem.json"]

[-> directories
    [map directory/read-recursive]
    [flatten]
    [filter [path/ext?! "nuj"]]
    [reduce [λ [a b] [tree/set! a
                                [string->keyword b]
                                @[name: b content: [file/read b]]]]]
    [val->json]
    [file/write output-file]]
[println [cat [ref ansi-bg 2] "[JSON]" ansi-bg-reset " " output-file]]