mirror of
https://github.com/aphrody-labs/gn.git
synced 2026-10-14 05:09:21 +00:00
Change-Id: I6af731713efdc7e3da3fda4aa23062db6a6a6964 Reviewed-on: https://gn-review.googlesource.com/c/gn/+/23923 Reviewed-by: Takuto Ikuta <tikuta@google.com>
27 lines
676 B
Bash
Executable File
27 lines
676 B
Bash
Executable File
#!/bin/bash -eu
|
|
|
|
NINJA_OUT_DIR="${NINJA_OUT_DIR:-out}"
|
|
|
|
check=false
|
|
if [[ "$#" -ge 1 && "$1" == "--diff" ]]; then
|
|
check=true
|
|
fi
|
|
|
|
# Ensure we're always running in the correct directory.
|
|
cd "$(dirname $(dirname "${BASH_SOURCE[0]}"))"
|
|
|
|
# If NOBUILD is set, we skip building GN. This is useful for
|
|
# CI, where we've just built it, and ninja is not present in the path.
|
|
if [[ -z "${NOBUILD:-}" ]]; then
|
|
echo Building gn...
|
|
ninja -C "${NINJA_OUT_DIR}" gn
|
|
fi
|
|
echo Generating new docs/reference.md...
|
|
content=$("${NINJA_OUT_DIR}/gn" help --markdown all)
|
|
|
|
if "${check}"; then
|
|
diff -u docs/reference.md <(echo "$content")
|
|
else
|
|
echo "$content" > docs/reference.md
|
|
fi
|