From 1f8140c95ced6b7ce291e16c26c80800fa4f1f9d Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Wed, 5 Jun 2024 01:18:21 -0300 Subject: Update README, misc cleanups --- src/cratera.cratera.d/lib.cratera | 8 ++------ src/host/genpath.lua | 10 +++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/cratera.cratera.d/lib.cratera b/src/cratera.cratera.d/lib.cratera index 6e1627e..69ca476 100644 --- a/src/cratera.cratera.d/lib.cratera +++ b/src/cratera.cratera.d/lib.cratera @@ -39,9 +39,5 @@ function cratera_env.load(chunk, chunkname, mode, env) end -- cratera opts not to support dostring/dofile. -if lua.dostring then - cratera_env.dostring = false -end -if lua.dofile then - cratera_env.dofile = false -end +cratera_env.dostring = false +cratera_env.dofile = false diff --git a/src/host/genpath.lua b/src/host/genpath.lua index e12e9a8..c11caab 100644 --- a/src/host/genpath.lua +++ b/src/host/genpath.lua @@ -2,8 +2,8 @@ -- package.path, but every .lua is replaced with .cratera -- or use an explicit CRATERA_PATH -if os.getenv("DEFAULT_CRATERA_PATH") then - print(string.format("return %q", os.getenv("DEFAULT_CRATERA_PATH"))) +if os.getenv("CRATERA_DEFAULT_PATH") then + print(string.format("return %q", os.getenv("CRATERA_DEFAULT_PATH"))) return end @@ -22,4 +22,8 @@ for path_part in possible_cratera_path:gmatch(pathfinder) do end end -print(string.format("return %q", table.concat(path_parts, pathsep))) +if arg[1] == "display" then + print(table.concat(path_parts, pathsep)) +else + print(string.format("return %q", table.concat(path_parts, pathsep))) +end -- cgit 1.4.1