mouse/version.sh
Jochen Maes e7e0720b54
Some checks failed
continuous-integration/drone/push Build is failing
adds version.sh to do some version manipulation during build
2023-11-01 08:41:33 +01:00

14 lines
345 B
Bash
Executable File

#!/bin/bash
# Get last created tag
LTCOMMIT=$(git rev-list --abbrev-commit --tags --max-count=1)
LTAG=$(git describe --abbrev=0 --tags ${LTCOMMIT} 2>/dev/null || true)
ADC=${DRONE_COMMIT:0:7}
if [[ "${LTCOMMIT}" == "${ADC}" ]]; then
VERSION="${DRONE_TAG##v}"
else
VERSION="${LTAG}-next-${ADV}"
fi
sed -i "s/0\\.0\\.0/${VERSION}/" Cargo.toml