Skip to content

Commit aa0617d

Browse files
committed
Handle trailing alpha in version()
1 parent 29b4dae commit aa0617d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

share/github-backup-utils/ghe-backup-config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,9 @@ ghe_debug() {
510510
version() {
511511
local v="${*#v}"
512512

513+
# Discard stderr and always return true as trailing alpha (eg. "v1.2.3pre") will upset printf
513514
# shellcheck disable=SC2183,SC2086 # We want to glob (SC2086) and expect 4 (fuzzy) params (SC2183)
514-
printf "%d%03d%03d%03d\n" ${v//./ }
515+
printf "%d%03d%03d%03d\n" ${v//./ } 2>/dev/null || true
515516
}
516517

517518
# The list of gists returned by the source changed in 2.16.23, 2.17.14,

0 commit comments

Comments
 (0)