aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.moon
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-03-22 14:37:50 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-03-22 14:38:01 -0700
commitf0f3c7e0bb42f67868a840f19492c69e03b7cf17 (patch)
tree681145f3c2cb723902cac287dc2aeedffb61e240 /nomsu_compiler.moon
parent7f30fb293f11744eaab6935e791c5aa993411722 (diff)
Fix for error reporting not finding core files
Diffstat (limited to 'nomsu_compiler.moon')
-rw-r--r--nomsu_compiler.moon6
1 files changed, 6 insertions, 0 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon
index 6fa9ffd..4b684a4 100644
--- a/nomsu_compiler.moon
+++ b/nomsu_compiler.moon
@@ -30,6 +30,12 @@ fail_at = (source, msg)->
if source and not file
file = Files.read(source.filename)
+ if not file
+ if NOMSU_PREFIX
+ path = "#{NOMSU_PREFIX}/share/nomsu/#{table.concat NOMSU_VERSION, "."}/#{source.filename}"
+ file = Files.read(path)
+ if not file
+ error("Can't find file: "..tostring(source.filename))
title, err_msg, hint = msg\match("([^:]*):[ \n]+(.*)[ \n]+Hint: (.*)")
if not err_msg