Prusa-Firmware/lang/lang-community.sh
3d-gussner 6ebdb004ab Add lang-community.sh script
Fix `Dutch` hex file copied in `PF-build.sh` for MK2.5/S
2021-03-01 08:25:33 +01:00

46 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
#
# lang-community.sh - Community language support script
# Check community languages are defined in `config.h`
#
# Root path
if [ -z "$ROOT_PATH" ]; then
export ROOT_PATH=".."
fi
# Check community language NL = Dutch
COMMUNITY_LANG_NL=$(grep --max-count=1 "^#define COMMUNITY_LANG_NL" $ROOT_PATH/Firmware/config.h| cut -d '_' -f3 |cut -d ' ' -f1)
export NL=$COMMUNITY_LANG_NL
# Use the lines below as a template and replace 'QR' and 'new language'
# Check comminity language QR = new language
#COMMUNITY_LANG_QR=$(grep --max-count=1 "^#define COMMUNITY_LANG_QR" $ROOT_PATH/Firmware/config.h| cut -d '_' -f3 |cut -d ' ' -f1)
#export QR=$COMMUNITY_LANG_QR
#startup message
echo "lang-community.sh started" >&2
echo -n " Source code path: " >&2
if [ -e $ROOT_PATH ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=1; fi
echo " Found: " >&2
if [ "$COMMUNITY_LANG_NL" = "NL" ]; then
echo " $COMMUNITY_LANG_NL" >&2
echo
./lang-build.sh nl
fi
#exiting function
finish()
{
if [ $1 -eq 0 ]; then
echo "lang-community.sh finished with success" >&2
else
echo "lang-community.sh finished with errors!" >&2
fi
echo
exit $1
}
finish 0