2022-11-09 14:58:06 +00:00
|
|
|
#!/usr/bin/env bash
|
2021-12-07 04:11:01 +00:00
|
|
|
|
2022-10-12 15:15:51 +00:00
|
|
|
set -e
|
|
|
|
|
2021-12-07 04:11:01 +00:00
|
|
|
# If $1 looks like v1.2.3 or v1.2.3-foo, strip the leading v, then print it to stdout
|
|
|
|
if [[ $1 =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-.+)?$ ]]; then
|
|
|
|
echo ${1:1}
|
|
|
|
else
|
|
|
|
echo $1
|
|
|
|
fi
|