Skip to content

Instantly share code, notes, and snippets.

@ctubbsii
Created February 21, 2019 22:07
Show Gist options
  • Save ctubbsii/7c14846c5162a1144d4a5d892c60f15f to your computer and use it in GitHub Desktop.
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
#! /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