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.moon | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nomsu_environment.moon') diff --git a/nomsu_environment.moon b/nomsu_environment.moon index 9dab5e9..00b8a3f 100644 --- a/nomsu_environment.moon +++ b/nomsu_environment.moon @@ -169,6 +169,7 @@ nomsu_environment = Importer{ _currently_running_files\add path mod = _1_forked(environment) + did_anything = false for nomsupath in package.nomsupath\gmatch("[^;]+") files = Files.list(nomsupath.."/"..path) continue unless files @@ -183,7 +184,10 @@ nomsu_environment = Importer{ file = Files.read(filename) NomsuCode\from(Source(filename, 1, #file), file) environment.run_1_in(code, mod) + did_anything = true break + unless did_anything + error("File not found: #{path}", 0) import_to_1_from(environment, mod, prefix) environment.FILE_CACHE[path] = mod _currently_running_files\remove! -- cgit v1.2.3