mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
i18n: move translation checking to pre-commit hook
This commit is contained in:
27
.githooks/pre-commit
Executable file
27
.githooks/pre-commit
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
|
||||
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
if [[ -z "${POEDITOR_API_TOKEN:-}" ]] || [[ -z "${POEDITOR_PROJECT_ID:-}" ]]; then
|
||||
echo "Skipping i18n sync check (POEDITOR_API_TOKEN or POEDITOR_PROJECT_ID not set)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! command -v python3 &>/dev/null; then
|
||||
echo "Warning: python3 not found, skipping i18n check"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! python3 scripts/i18nsync.py check 2>&1; then
|
||||
echo ""
|
||||
echo "Run: python3 scripts/i18nsync.py sync"
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user