diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-20 14:52:59 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-20 14:54:40 -0800 |
| commit | 2bbc035f5dcc3ecd62724b9d1de0e7e3ea902379 (patch) | |
| tree | 34a83497f7570946b6252183b3e8fe0ce2010595 /nomsu_environment.moon | |
| parent | f30413853063483147d941ffccc4b663b71bc943 (diff) | |
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`
Diffstat (limited to 'nomsu_environment.moon')
| -rw-r--r-- | nomsu_environment.moon | 4 |
1 files changed, 4 insertions, 0 deletions
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! |
