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"
module-based-network
Daniel Barlow 2023-07-08 22:14:40 +01:00
parent e7de889403
commit 708350711b
1 changed files with 6 additions and 2 deletions

View File

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