slightly rewrite Thomas' script and add to drone's syntax check
the build was successful
Detalhes
the build was successful
Detalhes
Esse commit está contido em:
pai
eacb4fb097
commit
8f9f61eb3b
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
Carregando…
Referência em uma nova issue