rm pre-commit hook for docs & mv error catch to package

This commit is contained in:
waalge 2023-01-23 06:56:45 +00:00
parent c8ce959207
commit e4dedcde75

View File

@ -299,17 +299,6 @@
fi 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 = docs =
pkgs.runCommand pkgs.runCommand
"dream2nix-docs" "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
"
''; '';
}; };
}; };