From 2bbc035f5dcc3ecd62724b9d1de0e7e3ea902379 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 20 Nov 2018 14:52:59 -0800 Subject: Simplifying the filesystem code (no longer entangled with nomsupath) and using that to simplify the tools. Now the tools directly take lists of file paths rather than things that might go through nomsupath or directories or get processed by filetype. Use your shell for globbing stuff like `nomsu tools/test.nom core/*.nom` --- nomsu_environment.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nomsu_environment.lua') diff --git a/nomsu_environment.lua b/nomsu_environment.lua index 7b26852..6f46640 100644 --- a/nomsu_environment.lua +++ b/nomsu_environment.lua @@ -296,6 +296,7 @@ local nomsu_environment = Importer({ end _currently_running_files:add(path) local mod = _1_forked(environment) + local did_anything = false for nomsupath in package.nomsupath:gmatch("[^;]+") do local _continue_0 = false repeat @@ -323,6 +324,7 @@ local nomsu_environment = Importer({ code = NomsuCode:from(Source(filename, 1, #file), file) end environment.run_1_in(code, mod) + did_anything = true _continue_1 = true until true if not _continue_1 then @@ -337,6 +339,9 @@ local nomsu_environment = Importer({ break end end + if not (did_anything) then + error("File not found: " .. tostring(path), 0) + end import_to_1_from(environment, mod, prefix) environment.FILE_CACHE[path] = mod return _currently_running_files:remove() -- cgit v1.2.3