fennelrepl look for .fnl before .lua

this means fennelrepl in nix-shell will prefer local
source files to generated lua files, making it easier
to change library code without restarting the shell
This commit is contained in:
Daniel Barlow 2023-09-09 00:11:35 +01:00
parent 9dd3cf23b4
commit 0312f7a999

View file

@ -28,7 +28,8 @@ in writeScriptBin "fennelrepl" ''
package.path = ${lib.strings.escapeShellArg luapath} .. ";" .. package.path package.path = ${lib.strings.escapeShellArg luapath} .. ";" .. package.path
package.cpath = ${lib.strings.escapeShellArg luacpath} .. ";" .. (package.cpath or "") package.cpath = ${lib.strings.escapeShellArg luacpath} .. ";" .. (package.cpath or "")
local fennel = require "fennel" local fennel = require "fennel"
fennel.install() table.insert(package.loaders or package.searchers,1, fennel.searcher)
local more_fennel = os.getenv("FENNEL_PATH") local more_fennel = os.getenv("FENNEL_PATH")
if more_fennel then if more_fennel then
fennel.path = more_fennel .. ";" .. fennel.path fennel.path = more_fennel .. ";" .. fennel.path