A2A/scripts/sort_spelling.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
480 B
Bash
Raw Permalink Normal View History

#!/bin/bash
set -euo pipefail
# Determine the repository root directory based on the script's location.
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
REPO_ROOT=$(cd -- "$SCRIPT_DIR/.." &>/dev/null && pwd)
ALLOW_FILE="${REPO_ROOT}/.github/actions/spelling/allow.txt"
echo "Sorting spelling allow list..."
[ -f "${ALLOW_FILE}" ] || {
echo "ERROR: Allow list not found: ${ALLOW_FILE}"
exit 1
}
LC_ALL=C sort -u -o "${ALLOW_FILE}" "${ALLOW_FILE}"