Skip to content
Snippets Groups Projects

Restructure pages regarding switched off systems

Merged Martin Schroschk requested to merge issue144 into preview
1 file
+ 22
7
Compare changes
  • Side-by-side
  • Inline
@@ -19,18 +19,33 @@ fi
any_fails=false
source_hash=`git merge-base HEAD "$branch"`
files=$(git diff --name-only "$source_hash")
for f in $files; do
if [ "${f: -3}" == ".md" ]; then
previous_count=`git show "$source_hash:$f" | getNumberOfAspellOutputLines`
current_count=`cat "$f" | getNumberOfAspellOutputLines`
#Remove everything except lines beginning with --- or +++
files=`git diff $source_hash | sed -n 's/^[-+]\{3,3\} //p'`
#Assume that we have pairs of lines (starting with --- and +++).
while read oldfile; do
read newfile
if [ "${newfile: -3}" == ".md" ]; then
if [ "$oldfile" == "/dev/null" ]; then
#Added files should not introduce new spelling mistakes
previous_count=0
else
previous_count=`git show "$source_hash:${oldfile:2}" | getNumberOfAspellOutputLines`
fi
if [ "$newfile" == "/dev/null" ]; then
#Deleted files do not contain any spelling mistakes
current_count=0
else
#Remove the prefix "b/"
newfile=${newfile:2}
current_count=`cat "$newfile" | getNumberOfAspellOutputLines`
fi
if [ $current_count -gt $previous_count ]; then
echo "-- File $f"
echo "-- File $newfile"
echo "Change increases spelling mistake count (from $previous_count to $current_count)"
any_fails=true
fi
fi
done
done <<< "$files"
if [ "$any_fails" == true ]; then
exit 1
Loading