liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 708350711b9ada1a0eeaf1455feb3cc3fe568e87
parent e7de8894037b61611ea90b3d24889a0241f88299
Author: Daniel Barlow <dan@telent.net>
Date:   Sat,  8 Jul 2023 22:14:40 +0100

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"

Diffstat:
Mpkgs/fennelrepl/default.nix | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pkgs/fennelrepl/default.nix b/pkgs/fennelrepl/default.nix @@ -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 ''