diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-27 14:40:14 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-27 14:40:28 -0700 |
| commit | c92cf76356129b69c15c3aeca30c745671874d88 (patch) | |
| tree | aeaea3b884da36a44811150078ef5240d1152c06 | |
| parent | 5f676b8e19167e4b2f0cab817000134d8adecf09 (diff) | |
Fix for finding source files when they're in the NOMSUPATH
| -rw-r--r-- | nomsu_environment.lua | 3 | ||||
| -rw-r--r-- | nomsu_environment.moon | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/nomsu_environment.lua b/nomsu_environment.lua index 9e57cc6..6671f38 100644 --- a/nomsu_environment.lua +++ b/nomsu_environment.lua @@ -360,6 +360,9 @@ nomsu_environment = Importer({ if not (self.SOURCE_MAP[source_key] or self.OPTIMIZATION >= 2) then local map = { } local file = Files.read(source.filename) + if not file and NOMSU_PREFIX then + file = Files.read(tostring(NOMSU_PREFIX) .. "/share/nomsu/" .. tostring(table.concat(NOMSU_VERSION, ".")) .. "/" .. tostring(source.filename)) + end if not file then error("Failed to find file: " .. tostring(source.filename)) end diff --git a/nomsu_environment.moon b/nomsu_environment.moon index c519b06..0f5f411 100644 --- a/nomsu_environment.moon +++ b/nomsu_environment.moon @@ -235,6 +235,8 @@ nomsu_environment = Importer{ unless @SOURCE_MAP[source_key] or @OPTIMIZATION >= 2 map = {} file = Files.read(source.filename) + if not file and NOMSU_PREFIX + file = Files.read("#{NOMSU_PREFIX}/share/nomsu/#{table.concat NOMSU_VERSION, "."}/#{source.filename}") if not file error "Failed to find file: #{source.filename}" nomsu_str = file\sub(source.start, source.stop) |
