29
30
Fork 85

slightly rewrite Thomas' script and add to drone's syntax check
the build was successful Detalhes

Esse commit está contido em:
Max Mehl 2018-12-04 14:59:10 +01:00
commit 8f9f61eb3b
Assinado por: max.mehl
ID da chave GPG: 2704E4AB371E2E92
3 arquivos alterados com 23 adições e 18 exclusões

Ver arquivo

@ -3,3 +3,4 @@ pipeline:
image: vsasyan/xmllint
commands:
- find . -type f \( -iname "*.xhtml" -o -iname "*.xml" -o -iname "*.xsl" \) -exec xmllint --noout {} +
- bash tools/check-non-en-frontpage.sh news

22
tools/check-non-en-frontpage.sh Executable file
Ver arquivo

@ -0,0 +1,22 @@
#/bin/bash
# checks whether there non-EN items appear on the FSFE front-page, which is undesired
DIR=$1
# select all items which have the front-page tag
exit=0
for f in $( grep -R "<tag.*>front-page</tag>" --files-with-matches ${DIR}/2*/*.{xhtml,xml} )
do
base="${f%.*}" # file.xx
base="${base%.*}" # file
sfx=${f##*.} # xhtml
en="$base.en.$sfx" # file.en.xhtml
if [[ ! -f "$en" ]]
then
echo "$f" # echo file if it's not existent in an English version
exit=1
fi
done
exit $exit

Ver arquivo

@ -1,18 +0,0 @@
#/bin/bash
ROOT=$(dirname "$(readlink -f "$0")")
source "$ROOT"/config.cfg
LOC_trunk=$(echo $LOC_trunk | sed 's|/$||')
cd ${LOC_trunk}/news
for f in $( grep -R front-page --files-with-matches 2*/*.{xhtml,xml} )
do
base="${f%.*}"
base="${base%.*}"
sfx=${f##*.}
en="$base.en.$sfx"
if [[ ! -f "$en" ]]
then
echo "$f"
fi
done