Permalink
Browse files

CI: Show error for new translators when license is bad (#1650)

  • Loading branch information...
zuphilip committed May 14, 2018
1 parent 5a17ede commit 7780c6555d471fd0d2bfa25212cd4b66fc0abbc3
Showing with 14 additions and 0 deletions.
  1. +14 −0 .ci/checkTranslator.sh
View
@@ -154,6 +154,20 @@ main() {
[[ ! -e $TRANSLATOR ]] && { usage "File/Directory not found.\n$TRANSLATOR"; exit 2; }
[[ -d $TRANSLATOR ]] && { usage "Must be a file not a directory."; exit 3; }
# For newly commited translators not only a warning
# but an error is shown for a bad or missing license.
local IFS=$'\n'
declare -a newtranslators=()
newtranslators+=($(git diff-index --diff-filter=A --name-only --find-renames master|grep -v '\.ci'|grep 'js$'))
if (( ${#newtranslators[@]} > 0 ));then
for t in "${newtranslators[@]}";do
if [ "$TRANSLATOR_BASENAME" == "$t" ];then
ERROR_CHECKS+=("badLicense")
unset WARN_CHECKS[0]
fi
done
fi
declare -a errors=() warnings=()
for check in "${ERROR_CHECKS[@]}";do $check || errors+=($check); done
if [[ -z "$SKIP_WARN" ]];then

0 comments on commit 7780c65

Please sign in to comment.