#!/usr/bin/env bash# this requires `master` in the git tree# travis-ci branch builds are unable to set the version properlyPLIST_FILE_SRC=$1PLIST_FILE_DST=$2BUILD_CODE=`git rev-list master --first-parent--count`VERSION_CODE=`git describe --always--tags | sed-e's/[^0-9.]*\([0-9.]*\).*/\1/'`if[-z"$BUILD_CODE"-o-z"$VERSION_CODE"];thenecho"Error: Version and/or build empty."exit 1 # Cause the build to failelseecho"Version: ${VERSION_CODE}"echo"Build: ${BUILD_CODE}"fised-e"s/\###BUILD###/${BUILD_CODE}/"-e"s/\###VERSION###/${VERSION_CODE}/"$PLIST_FILE_SRC>$PLIST_FILE_DST