commit 024c018262c85860cd07769a579d2d2ed2088681
parent e1293e37785d42519ca262e28087f3ec84218dd1
Author: Daniel Barlow <dan@telent.net>
Date: Sat, 22 Feb 2025 00:10:19 +0000
run the output-template test
Diffstat:
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/pkgs/watch-outputs/Makefile b/pkgs/watch-outputs/Makefile
@@ -1,3 +1,3 @@
check:
- ./output-template '{{' '}}' < example.ini > output
+ fennelrepl ./test.fnl '{{' '}}' < example.ini > output
diff -u output example.ini.expected
diff --git a/pkgs/watch-outputs/default.nix b/pkgs/watch-outputs/default.nix
@@ -2,6 +2,7 @@
fetchurl,
writeFennel,
fennel,
+ fennelrepl,
runCommand,
lua,
anoia,
@@ -17,6 +18,7 @@ stdenv.mkDerivation {
src = ./.;
buildInputs = [ lua ];
+ nativeBuildInputs = [ fennelrepl ] ;
# doCheck = true;
buildPhase = ''
@@ -31,6 +33,7 @@ stdenv.mkDerivation {
mainFunction = "run";
} ./watch-outputs.fnl
} ${name}
+ make check
'';
# checkPhase = "make check";
installPhase = ''
diff --git a/pkgs/watch-outputs/output-template.fnl b/pkgs/watch-outputs/output-template.fnl
@@ -28,7 +28,7 @@
(fn [service-path path]
(let [s (assert (svc.open (.. service-path "/.outputs")))]
(s:output path)))
- :lua_quote #(string.format "%q" %1)
+ :lua_quote #(string.format "%q" $1)
:json_quote (fn [x] (.. "\"" (json-escape x) "\""))
}]
(string.gsub text delim