Login
7 branches 0 tags
Ben (X13/Arch) Minor termed code cleanup 573d0ab 2 months ago 1252 Commits
nujel / tools / buildwasm-filesystem.nuj
#!/usr/bin/env nujel

(import (serialize :as val->json) :serialization/json)

(def directories '("binlib" "stdlib" "tests" "testsuite" "tools"))
(def output-file "web/filesystem.json")

(-> directories
    (map directory/read-recursive)
    (flatten)
    (filter (path/ext?! "nuj"))
    (reduce (fn (a b)
                (set! a (: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))