summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathew Inwood <mathewi@google.com> 2018-09-14 21:55:58 -0700
committer android-build-merger <android-build-merger@google.com> 2018-09-14 21:55:58 -0700
commit57a4bae7c3c79449fcb271375c8e3474a329f716 (patch)
tree5b6a7a7ed50df10cf22506add4b954651eb53e89
parent65e63ce0de5107ed95060b26e9fb02a5b637249c (diff)
parentdaabcae9557b085d7b9d3b1945753718b734f332 (diff)
Merge "Don't fail if there are no comments."
am: daabcae955 Change-Id: I7d8139a98913ae17491f73314bd426287374c270
-rwxr-xr-xtools/hiddenapi/sort_api.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/hiddenapi/sort_api.sh b/tools/hiddenapi/sort_api.sh
index bdcc8076dde1..76a2f2d6eba1 100755
--- a/tools/hiddenapi/sort_api.sh
+++ b/tools/hiddenapi/sort_api.sh
@@ -12,8 +12,8 @@ readarray A < "$source_list"
# Sort
IFS=$'\n'
# Stash away comments
-C=( $(grep -E '^#' <<< "${A[*]}") )
-A=( $(grep -v -E '^#' <<< "${A[*]}") )
+C=( $(grep -E '^#' <<< "${A[*]}" || :) )
+A=( $(grep -v -E '^#' <<< "${A[*]}" || :) )
# Sort entries
A=( $(LC_COLLATE=C sort -f <<< "${A[*]}") )
A=( $(uniq <<< "${A[*]}") )