Log output of `cargo doc` in `check_docs`
@@ -6,8 +6,10 @@ readonly SCRIPTS_DIR="$(dirname "$(readlink -f "$0")")"
# shellcheck source=scripts/common
source "$SCRIPTS_DIR/common"
+DOCS_OUT="$(cargo doc --document-private-items --no-deps 2>&1)"
+
# `cargo doc` produces warnings for incorrect paths. These warnings cannot be promoted to errors, so we use grep to detect them.
-if cargo doc --document-private-items --no-deps 2>&1 | grep --ignore-case --quiet --regexp='^warning'; then
+if grep --ignore-case --quiet --regexp='^warning' <<< "$DOCS_OUT"; then
echo "Warnings found when generating the docs."
exit 1
fi
