Created
February 21, 2019 22:07
-
-
Save ctubbsii/7c14846c5162a1144d4a5d892c60f15f to your computer and use it in GitHub Desktop.
Thrift command wrapper to switch automatically between different thrift versions when building Accumulo branches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/bash | |
set -e | |
rootDir=$(git rev-parse --show-toplevel) | |
ver=$(xmllint --shell "$rootDir/pom.xml" <<<'xpath /*[local-name()="project"]/*[local-name()="properties"]/*[local-name()="thrift.version"]/text()' | grep content= | cut -f2 -d=) | |
if [[ -x ~/bin/thrift-$ver ]]; then | |
~/bin/thrift-"$ver" "$@" | |
else | |
~/bin/thrift-0.11.0 "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment