From 1305dc9e3ff5086abd17097534ae1bbbf3f22647 Mon Sep 17 00:00:00 2001 From: TitouanT Date: Tue, 23 Feb 2021 10:43:44 +0100 Subject: [PATCH] call main\1 predicate with arguments list if any --- lxc/executors/prolog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lxc/executors/prolog b/lxc/executors/prolog index ec6aeda..d9a6211 100755 --- a/lxc/executors/prolog +++ b/lxc/executors/prolog @@ -5,4 +5,9 @@ cd /tmp/$1 sed 's/^.*$/:- forall((Goal = (\0), call(Goal)), (write(Goal), nl))./' stdin.stdin | cat code.code - > code.pl +if [ -s args.args ] +then + echo ":- main($(jq --raw-input -c --slurp 'split("\n")' args.args))." >> code.pl +fi + timeout -s KILL 3 swipl -g true -t halt code.pl