Skip to content

Commit 71036b2

Browse files
authored
Merge pull request #27 from reecetech/maintenance
Remove old code blocks
2 parents 89a53df + bfdbc11 commit 71036b2

2 files changed

Lines changed: 0 additions & 33 deletions

File tree

tests/test_version-lookup.bats

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,6 @@ function init_repo {
110110
[[ "$output" = *"CURRENT_VERSION=$(date '+%Y.%-m.0')"* ]]
111111
}
112112

113-
@test "converts from older calver scheme automatically" {
114-
init_repo
115-
116-
git tag 2020-09-R2
117-
118-
run ../../version-lookup.sh
119-
120-
print_run_info
121-
[ "$status" -eq 0 ] &&
122-
[[ "$output" = *"CURRENT_VERSION=2020.9.2"* ]]
123-
}
124-
125113
@test "strips v from the version" {
126114
init_repo
127115

version-lookup.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,6 @@ if [[ "${input_errors}" == 'true' ]] ; then
1010
exit 8
1111
fi
1212

13-
##==----------------------------------------------------------------------------
14-
## MacOS compatibility - for local testing
15-
16-
export grep="grep"
17-
if [[ "$(uname)" == "Darwin" ]] ; then
18-
export grep="ggrep"
19-
if ! grep --version 1>/dev/null ; then
20-
echo "🛑 GNU grep not installed, try brew install coreutils" 1>&2
21-
exit 9
22-
fi
23-
fi
24-
2513
##==----------------------------------------------------------------------------
2614
## Get tags from GitHub repo
2715

@@ -53,15 +41,6 @@ else
5341
)"
5442
fi
5543

56-
# 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)
57-
if [[ -z "${current_version:-}" ]] ; then
58-
current_version="$(git tag -l | { ${grep} -P "${pcre_old_calver}" || true; } | sort -V | tail -n 1)"
59-
if [[ -n "${current_version:-}" ]] ; then
60-
# convert - to . and drop leading zeros & the R
61-
current_version="$(echo "${current_version}" | sed -r 's/^([0-9]+)-0{0,1}([0-9]+)-R0{0,1}([0-9]+)$/\1.\2.\3/')"
62-
fi
63-
fi
64-
6544
# handle no version detected - start versioning!
6645
if [[ -z "${current_version:-}" ]] ; then
6746
echo "⚠️ No previous release version identified in git tags"

0 commit comments

Comments
 (0)