Files
awslabs_aws-crt-php/dev-scripts/update_version.sh
T
2023-02-28 17:14:55 -08:00

16 lines
328 B
Bash
Executable File

#!/usr/bin/env bash
set -ex
BASENAME=${0}
TOOLS_DIR=$(dirname ${BASENAME})
WORK_DIR="${TOOLS_DIR}/.."
cd "${WORK_DIR}"
version_with_v=$(git describe --tags --abbrev=0)
VERSION=$(echo ${version_with_v} | cut -f2 -dv)
sed -i "s/#define CRT_VERSION .*/#define CRT_VERSION \"$VERSION\"/g" ext/crt.c
export VERSION="${VERSION}"