Rename the temporary Git clone directory variable for clarity

This commit is contained in:
Hugo Locurcio
2020-09-13 19:34:33 +02:00
parent e2348c8ec5
commit 739b29c050

View File

@@ -4,16 +4,16 @@ set -euo pipefail
IFS=$'\n\t'
cd "$(dirname "${BASH_SOURCE[0]}")"
TMP="$(mktemp -d)"
git clone --depth=1 https://github.com/godotengine/godot.git "$TMP"
GODOT_TMP_DIR="$(mktemp -d)"
git clone --depth=1 https://github.com/godotengine/godot.git "$GODOT_TMP_DIR"
# Generate a Markdown table of the class reference coverage.
mkdir -p content/
rm -f content/_index.md
# Add Git commit information to the generated page.
COMMIT_HASH="$(git -C "$TMP" rev-parse --short=9 HEAD)"
COMMIT_DATE="$(git -C "$TMP" log -1 --pretty=%cd --date=format:%Y-%m-%d)"
COMMIT_HASH="$(git -C "$GODOT_TMP_DIR" rev-parse --short=9 HEAD)"
COMMIT_DATE="$(git -C "$GODOT_TMP_DIR" log -1 --pretty=%cd --date=format:%Y-%m-%d)"
echo -e "\nBuilding status page for Godot commit $COMMIT_HASH ($COMMIT_DATE):"
echo "https://github.com/godotengine/godot/commit/$COMMIT_HASH"
@@ -33,7 +33,7 @@ EOF
# Trim the first line of the output to get a valid Markdown table.
# Ensure that module documentation is also included in the report.
python3 "$TMP/doc/tools/doc_status.py" -u "$TMP/doc/classes" "$TMP"/modules/*/doc_classes | tail -n +2 >> content/_index.md
python3 "$GODOT_TMP_DIR/doc/tools/doc_status.py" -u "$GODOT_TMP_DIR/doc/classes" "$GODOT_TMP_DIR"/modules/*/doc_classes | tail -n +2 >> content/_index.md
# Fade out `0/0` completion ratios as they can't be completed (there's nothing to document).
sed -i 's:0/0:<span style="opacity\: 0.5">0/0</span>:g' content/_index.md
@@ -50,4 +50,4 @@ sed -Ei 's:(https\:.+(class_.+)\.html):[\2](\1):g' content/_index.md
# Build the website with optimizations enabled.
hugo --minify
rm -rf "$TMP"
rm -rf "$GODOT_TMP_DIR"