liminix/pkgs/anoia/init.fnl
Daniel Barlow 9dd3cf23b4 anoia.fs.mktree replaces mkdir
This uses lfs to make the tree in-process instead of
shelling out to the mkdir command
2023-09-08 21:17:42 +01:00

16 lines
351 B
Fennel

(fn merge [table1 table2]
(collect [k v (pairs table2) &into table1]
k v))
(fn split [sep string]
(icollect [v (string.gmatch string (.. "([^" sep "]+)"))]
v))
(fn file-exists? [name]
(match (io.open name :r)
f (do (f:close) true)
_ false))
(fn system [s] (assert (os.execute s)))
{ : merge : split : file-exists? : system }