cargo/ci/validate-man.sh
Sebastian Thiel 7715010c08
Prevent false positives when checking for changes in src/doc.
When changing cargo versions from stable to nightly, it's possible
that the Cargo.lock format changes ever so slightly. This leaves
the `Cargo.lock` file changed which is picked up by `git status`.

This patch adjusts the `git status` invocation to limit itself
to the CWD.
2023-04-18 17:52:55 +01:00

27 lines
554 B
Bash
Executable File

#!/bin/bash
# This script validates that there aren't any changes to the man pages.
set -e
cd src/doc
changes=$(git status --porcelain -- .)
if [ -n "$changes" ]
then
echo "git directory must be clean before running this script."
exit 1
fi
./build-man.sh
changes=$(git status --porcelain -- .)
if [ -n "$changes" ]
then
echo "Detected changes of man pages in src/doc:"
echo "$changes"
echo
echo "Please run './build-man.sh' in the src/doc directory to rebuild the"
echo "man pages, and commit the changes."
exit 1
fi