From e4dedcde75e383c56e4940d307edaa0a6e56c1d9 Mon Sep 17 00:00:00 2001 From: waalge Date: Mon, 23 Jan 2023 06:56:45 +0000 Subject: [PATCH] rm pre-commit hook for docs & mv error catch to package --- flake.nix | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/flake.nix b/flake.nix index e8a2abbe..4ad201f0 100644 --- a/flake.nix +++ b/flake.nix @@ -299,17 +299,6 @@ fi ''); }; - build-docs = { - enable = true; - name = "build-docs"; - entry = l.toString (pkgs.writeScript "build-docs" '' - #!${pkgs.bash}/bin/bash - errors=$(mdbook build docs/ 2>&1 | grep ERROR) # no better way?! - if [ "$errors" ]; then - exit 1 - fi - ''); - }; }; }; }; @@ -317,9 +306,14 @@ docs = pkgs.runCommand "dream2nix-docs" - {nativeBuildInputs = [pkgs.mdbook];} + {nativeBuildInputs = [pkgs.bash pkgs.mdbook];} '' - mdbook build -d $out ${./.}/docs + bash -c " + errors=$(mdbook build -d $out ${./.}/docs |& grep ERROR) + if [ \"$errors\" ]; then + exit 1 + fi + " ''; }; };