fix(scripts): stop release script failing in diff size logic

There were two problems with the logic to conditionally warn about the
size of the diff in the private repo PR, introduced in 11f41bfb1:

* It used the return code rather than the result string from the `expr`
  command. This meant the positive branch of the test was never entered.

* It didn't trim whitespace from the `wc -l` result.

This change fixes both problems.
This commit is contained in:
Phil Booth 2019-04-24 09:57:58 +01:00
Родитель f63cb7dbe8
Коммит 5dfa374aa2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 36FBB106F9C32516
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -365,9 +365,8 @@ echo " https://github.com/mozilla/fxa/compare/$TRAIN_BRANCH?expand=1"
echo " https://github.com/mozilla/fxa-private/compare/$PRIVATE_BRANCH?expand=1"
echo
PRIVATE_DIFF_SIZE=`git diff "$PRIVATE_BRANCH..$PRIVATE_DIFF_FROM" | wc -l`
expr "$PRIVATE_DIFF_SIZE" \> 300 > /dev/null
IS_BIG_RELEASE="$?"
PRIVATE_DIFF_SIZE=`git diff "$PRIVATE_BRANCH..$PRIVATE_DIFF_FROM" | wc -l | awk '{$1=$1};1'`
IS_BIG_RELEASE=`expr "$PRIVATE_DIFF_SIZE" \> 300`
if [ "$IS_BIG_RELEASE" = "1" ]; then
echo "The diff for the private release is pretty big. You may want to add the following comment to that PR:"
echo