mirror of
https://github.com/reecetech/version-increment.git
synced 2025-12-21 14:35:44 +00:00
Remove transitional code
We don't have any more projects at `reecetech` that use the older non-semver compliant calver versioning
This commit is contained in:
@@ -110,18 +110,6 @@ function init_repo {
|
|||||||
[[ "$output" = *"CURRENT_VERSION=$(date '+%Y.%-m.0')"* ]]
|
[[ "$output" = *"CURRENT_VERSION=$(date '+%Y.%-m.0')"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "converts from older calver scheme automatically" {
|
|
||||||
init_repo
|
|
||||||
|
|
||||||
git tag 2020-09-R2
|
|
||||||
|
|
||||||
run ../../version-lookup.sh
|
|
||||||
|
|
||||||
print_run_info
|
|
||||||
[ "$status" -eq 0 ] &&
|
|
||||||
[[ "$output" = *"CURRENT_VERSION=2020.9.2"* ]]
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "strips v from the version" {
|
@test "strips v from the version" {
|
||||||
init_repo
|
init_repo
|
||||||
|
|
||||||
|
|||||||
@@ -41,15 +41,6 @@ else
|
|||||||
)"
|
)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# support transition from an old reecetech calver style (yyyy-mm-Rr, where R is the literal `R`, and r is the nth release for the month)
|
|
||||||
if [[ -z "${current_version:-}" ]] ; then
|
|
||||||
current_version="$(git tag -l | { ${grep} -P "${pcre_old_calver}" || true; } | sort -V | tail -n 1)"
|
|
||||||
if [[ -n "${current_version:-}" ]] ; then
|
|
||||||
# convert - to . and drop leading zeros & the R
|
|
||||||
current_version="$(echo "${current_version}" | sed -r 's/^([0-9]+)-0{0,1}([0-9]+)-R0{0,1}([0-9]+)$/\1.\2.\3/')"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# handle no version detected - start versioning!
|
# handle no version detected - start versioning!
|
||||||
if [[ -z "${current_version:-}" ]] ; then
|
if [[ -z "${current_version:-}" ]] ; then
|
||||||
echo "⚠️ No previous release version identified in git tags"
|
echo "⚠️ No previous release version identified in git tags"
|
||||||
|
|||||||
Reference in New Issue
Block a user