slightly rewrite Thomas' script and add to drone's syntax check
All checks were successful
the build was successful
All checks were successful
the build was successful
This commit is contained in:
parent
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
|
||||
|
22
tools/check-non-en-frontpage.sh
Executable file
22
tools/check-non-en-frontpage.sh
Executable file
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user