0
0
Fork 0
mirror of https://github.com/mumble-voip/mumble.git synced 2025-03-15 13:05:01 +00:00
mumble-voip_mumble/.ci/azure-pipelines/assertNoTranslationChanges.sh
Robert Adam 330c356e71 MAINT: Remove copyright year from all copyright notices
Keeping these up-to-date is just super tedious and they don't really
fulfill any purpose these days.
2024-09-30 18:06:20 +02:00

36 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Copyright The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.
set -e
# Get path to the updatetranslations script
updateScript="$BUILD_SOURCESDIRECTORY/scripts/updatetranslations.py"
# Get current commit hash
oldHash=`git rev-parse HEAD`
# In order for any commits to be possible, we'll have to set up a dummy user
git config user.name "CI"
git config user.email "ci@mumble.info"
# Execute updatetranslations that'll commit any translation changes
python3 $updateScript --ci-mode
echo
# Ger new commit hash
newHash=`git rev-parse HEAD`
# Check if the commit hash has changed (aka whether a commit has been made).
# If so that means that there are unprocessed translation changes.
if [[ "$oldHash" = "$newHash" ]]; then
echo "No translations have changed"
exit 0
else
git diff HEAD^
echo "[ERROR]: There are unprocessed translation changes!"
exit 1
fi