mirror of
https://github.com/Ralim/IronOS.git
synced 2025-07-23 20:30:38 +02:00
Langs check (#2006)
* source/Makefile: add temp change for demo * scripts/deploy.sh: add test check for languages * scripts/deploy.sh: shellcheck sanitization * source/Makefile: revert changes for the demo
This commit is contained in:
@@ -90,6 +90,22 @@ docs_history()
|
|||||||
return "${ret}"
|
return "${ret}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# source/Makefile:ALL_LANGUAGES & Translations/*.json automagical routine
|
||||||
|
build_langs()
|
||||||
|
{
|
||||||
|
mk="../source/Makefile"
|
||||||
|
cd Translations/ || exit 1
|
||||||
|
langs="$(echo "$(find ./*.json | sed -ne 's,^\./translation_,,; s,\.json$,,; /[A-Z]/p' ; sed -ne 's/^ALL_LANGUAGES=//p;' "${mk}")" | sed 's, ,\n,g; s,\r,,g' | sort | uniq -u)"
|
||||||
|
ret=0
|
||||||
|
if [ -n "${langs}" ]; then
|
||||||
|
ret=1
|
||||||
|
echo "It seems there is mismatch between supported languages and enabled builds."
|
||||||
|
echo "Please, check files in Translations/ and ALL_LANGUAGES variable in source/Makefile for:"
|
||||||
|
echo "${langs}"
|
||||||
|
fi;
|
||||||
|
return "${ret}"
|
||||||
|
}
|
||||||
|
|
||||||
# Helper function to check code style using clang-format & grep/sed custom parsers:
|
# Helper function to check code style using clang-format & grep/sed custom parsers:
|
||||||
# - basic logic moved from source/Makefile : `check-style` target for better maintainance since a lot of sh script involved;
|
# - basic logic moved from source/Makefile : `check-style` target for better maintainance since a lot of sh script involved;
|
||||||
# - output goes in gcc-like error compatible format for IDEs/editors.
|
# - output goes in gcc-like error compatible format for IDEs/editors.
|
||||||
@@ -173,7 +189,9 @@ if [ "docs" = "${cmd}" ]; then
|
|||||||
readme="${?}"
|
readme="${?}"
|
||||||
docs_history
|
docs_history
|
||||||
hist="${?}"
|
hist="${?}"
|
||||||
if [ "${readme}" -eq 0 ] && [ "${hist}" -eq 0 ]; then
|
build_langs
|
||||||
|
langs="${?}"
|
||||||
|
if [ "${readme}" -eq 0 ] && [ "${hist}" -eq 0 ] && [ "${langs}" -eq 0 ]; then
|
||||||
ret=0
|
ret=0
|
||||||
else
|
else
|
||||||
ret=1
|
ret=1
|
||||||
@@ -195,6 +213,11 @@ if [ "docs_history" = "${cmd}" ]; then
|
|||||||
exit "${?}"
|
exit "${?}"
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
|
if [ "build_langs" = "${cmd}" ]; then
|
||||||
|
build_langs
|
||||||
|
exit "${?}"
|
||||||
|
fi;
|
||||||
|
|
||||||
if [ "check_style_file" = "${cmd}" ]; then
|
if [ "check_style_file" = "${cmd}" ]; then
|
||||||
check_style_file "${2}"
|
check_style_file "${2}"
|
||||||
exit "${?}"
|
exit "${?}"
|
||||||
|
Reference in New Issue
Block a user