add pre-commit hook for book

This commit is contained in:
waalge 2023-01-14 11:39:56 +00:00
parent e156d5d19f
commit 7a3e7af2cc

View File

@ -299,6 +299,17 @@
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
'');
};
};
};
};