Mathew Inwood | a10f2e2 | 2018-04-23 16:13:14 +0100 | [diff] [blame] | 1 | #!/bin/bash |
2 | set -e | ||||
3 | LOCAL_DIR="$( dirname ${BASH_SOURCE} )" | ||||
4 | git show --name-only --pretty=format: $1 | grep "config/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 $2/frameworks/base/$file\e[0m" | ||||
8 | exit 1 | ||||
9 | } | ||||
10 | done |