diff --git a/scripts/protocgen.sh b/scripts/protocgen.sh index a64e642db..d316120ee 100755 --- a/scripts/protocgen.sh +++ b/scripts/protocgen.sh @@ -1,11 +1,12 @@ #!/usr/bin/env bash -set -eo pipefail +set -euxo pipefail # By default, this script runs against the latest commit to the master branch # in the Tendermint spec repository. To use this script with a different version # of the spec repository, run it with the $VERS environment variable set to the # desired commit in the spec repo. +VERS=5f16657dcfbb9b8d68eabe6a23672f86a4fde12d : ${VERS:=master} URL_PATH=tarball/ if [[ VERS -ne master ]]; then diff --git a/scripts/protopackage.sh b/scripts/protopackage.sh index da3fcf158..46183417f 100755 --- a/scripts/protopackage.sh +++ b/scripts/protopackage.sh @@ -1,5 +1,5 @@ #!/usr/bin/sh -set -euo pipefail +set -eo pipefail # This script appends the "option go_package" proto option to the file located at $FNAME. # This option specifies what the package will be named when imported by other packages. @@ -16,7 +16,7 @@ if [[ ! -z "$3" ]]; then fi -if ! grep -q 'option\s\+go_package\s\+=\s\+.*;' $FNAME; then +if ! `grep -q 'option\s\+go_package\s\+=\s\+.*;' $FNAME`; then sed -i "s/\(package tendermint.*\)/\1\n\noption go_package = \"$MODNAME\/$PACKAGE\";/g" $FNAME else sed -i "s/option\s\+go_package\s\+=\s\+.*;/option go_package = \"$MODNAME\/$PACKAGE\";/g" $FNAME