1#!/bin/bash 2set -e 3LOCAL_DIR="$( dirname ${BASH_SOURCE} )" 4git show --name-only --pretty=format: $1 | grep "hiddenapi/hiddenapi-.*txt" | while read file; do 5 diff <(git show $1:$file) <(git show $1:$file | $LOCAL_DIR/sort_api.sh ) || { 6 echo -e "\e[1m\e[31m$file $1 is not sorted or contains duplicates. To sort it correctly:\e[0m" 7 echo -e "\e[33m${LOCAL_DIR}/sort_api.sh $PWD/$file\e[0m" 8 exit 1 9 } 10done 11