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
doc-do-over
Daniel Barlow 2023-09-09 00:11:35 +01:00
parent 9dd3cf23b4
commit 0312f7a999
1 changed files with 2 additions and 1 deletions

View File

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