]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_core/commitdiff
Move loop over filesystem compilation to own file
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 29 Jul 2017 20:22:46 +0000 (16:22 -0400)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 31 Jul 2017 11:59:13 +0000 (07:59 -0400)
util/compileall.lua [new file with mode: 0644]

diff --git a/util/compileall.lua b/util/compileall.lua
new file mode 100644 (file)
index 0000000..6ea0d98
--- /dev/null
@@ -0,0 +1,8 @@
+-- find all /.*\.lua/ files except "init.lua" and compile them.
+local k,v
+for k,v in pairs(file.list()) do
+  local ix, _ = k:find("^.*%.lua$")
+  if ix and k ~= "init.lua" then
+    node.compile(k); file.remove(k)
+  end
+end