mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-28 03:46:33 +00:00
fix scripts to not duplicate go_option
This commit is contained in:
@@ -7,6 +7,8 @@ if [[ VERS -ne master ]]; then
|
||||
URL_PATH=tarball/refs/tags/v
|
||||
fi
|
||||
|
||||
VERS=5dddbbef96b6b39237e7a113363da0ffa0bdf21f
|
||||
|
||||
echo "fetching proto files"
|
||||
|
||||
# Get shortened ref of commit
|
||||
|
||||
@@ -8,6 +8,8 @@ set -eo pipefail
|
||||
|
||||
FNAME=$1
|
||||
MODNAME=$(echo $2| sed 's/\//\\\//g')
|
||||
PACKAGE="$(dirname $FNAME | cut -c 2- | sed 's/\//\\\//g')"
|
||||
PACKAGE="$(dirname $FNAME | sed 's/^\.\/\(.*\)/\1/g' | sed 's/\//\\\//g')"
|
||||
|
||||
sed -i "s/\(package tendermint.*\)/\1\n\noption go_package = \"$MODNAME$PACKAGE\";/g" $FNAME
|
||||
if ! `grep -q 'option go_package = .*;' $FNAME`; then
|
||||
sed -i "s/\(package tendermint.*\)/\1\n\noption go_package = \"$MODNAME\/$PACKAGE\";/g" $FNAME
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user