From b4ee79f184ebe1b6a1681fae6681072521a6a0b9 Mon Sep 17 00:00:00 2001 From: Ding Xiang Fei Date: Wed, 20 Jun 2018 11:28:32 +0800 Subject: [PATCH] make protobuf build persistent on travis ci --- install_protobuf.sh | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/install_protobuf.sh b/install_protobuf.sh index 8e4dd9f..c44ea4a 100644 --- a/install_protobuf.sh +++ b/install_protobuf.sh @@ -1,19 +1,15 @@ #!/usr/bin/bash set -e +PROTOC_VERSION=$(cat PROTOC_VERSION) + check_protoc_version () { - PROTOC_VERSION=$(cat PROTOC_VERSION) - PROTOC="protoc" - if [ -f $PROTOC ]; then - this_version=`$PROTOC --version` - return `[ "$PROTOC_VERSION" = "$this_version" ]` - else - return 1 - fi + this_version=`protoc --version` + return `[ "$PROTOC_VERSION" = "$this_version" ]` } -if check_protoc_version '3.5.1'; then - echo protoc version 3.5.1 detected. +if check_protoc_version; then + echo $PROTOC_VERSION detected. exit fi