diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 17:22:23 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-06-23 17:22:43 -0700 |
| commit | 863983202ce4ef92d9e3a296a682535d157c245d (patch) | |
| tree | 288411a534c8a64542ce1b101b9532cb12f11c7d /lib | |
| parent | 0d888db6324ecd879ba770880173255b6c3f7ae5 (diff) | |
Fixed up nomsupath behavior and refactored file stuff into its own file.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/os.nom | 19 | ||||
| -rw-r--r-- | lib/version.nom | 1 |
2 files changed, 15 insertions, 5 deletions
@@ -1,5 +1,10 @@ use "core" +action [path of Nomsu file %filename] + lua> ".." + for f in files.walk(\%filename) do return f end + barf "Could not find file: \%filename" + action [sh> %cmd] lua> ".." local result = io.popen(\%cmd) @@ -8,11 +13,15 @@ action [sh> %cmd] return contents action [read file %filename] - lua> ".." - local file = io.open(\%filename) - local contents = file:read("*a") - file:close() - return contents + =lua "files.read(\%filename)" + +compile [for file %f in %path %body] to + Lua ".." + for \(%f as lua expr) in files.walk(\(%path as lua expr)) do + \(%body as lua statements) + \(compile as: === next %f ===) + end + \(compile as: === stop %f ===) action [write to file %filename %text, to file %filename write %text] lua> ".." diff --git a/lib/version.nom b/lib/version.nom new file mode 100644 index 0000000..3b90888 --- /dev/null +++ b/lib/version.nom @@ -0,0 +1 @@ +lua> "NOMSU_LIB_VERSION = 2" |
