allow running scripts using fennelrepl

e.g.

FENNEL_PATH=pkgs/?/init.fnl\;pkgs/?.fnl nix-shell --run "fennelrepl ./examples/acquire-delegated-prefix.fnl /tmp/boo eth1"
This commit is contained in:
Daniel Barlow 2023-07-08 22:14:40 +01:00
parent e7de889403
commit 708350711b

View file

@ -29,6 +29,10 @@ in writeScriptBin "fennelrepl" ''
if more_fennel then
fennel.path = more_fennel .. ";" .. fennel.path
end
print("path", fennel.path)
if #arg > 0 then
script = table.remove(arg, 1)
fennel.dofile(script, {}, arg)
else
fennel.repl()
end
''