HEX
Server: Apache
System: Linux srv13.cpanelhost.cl 3.10.0-962.3.2.lve1.5.38.el7.x86_64 #1 SMP Thu Jun 18 05:28:41 EDT 2020 x86_64
User: cca63905 (4205)
PHP: 7.3.20
Disabled: NONE
Upload Files
File: /home4/cca63905/public_html/guiaweb/dev/tools/fixaltlanguages_pre-commit.sh
#!/bin/bash
# Wrapper to run 'fixaltlanguages.sh' from pre-commit hook
#
# Copyright (C) 2024		MDW							<mdeweerd@users.noreply.github.com>


# Note: regex in pre-commit based on list of fixed alt languages when run for
#       all cases (or all languages with more than one code in the project).
#
# Perl script:
#
#     ```perl
#     use Regexp::Optimizer;
#     my $o = Regexp::Optimizer->new;
#     my $re= "am|ar|bn|br|bs|ca|cs|cy|da|de|el|en|es|et|eu|fa|fr|gl|he|hi"
#           ."|it|ja|ka|kk|km|kn|ko|lo|ms|my|nb|ne|nl|pt|ru|sl|sq|sr|sv|ta"
#           ."|tg|uk|ur|vi|zh";
#     my $newRe=$o->optimize(qr/$re/);
#     print $newRe;
#     ```

MYDIR=$(dirname "$(realpath "$0")")

exit_code=0
for file in "$@" ; do
	if ! "${MYDIR}/fixaltlanguages.sh" fix "$file" ; then
		exit_code=$?
	fi
done
exit $exit_code