From 208963c4670701827f48fe4495949251f64c0843 Mon Sep 17 00:00:00 2001 From: michelia Date: Thu, 28 Nov 2024 15:19:19 +0800 Subject: [PATCH] chore: update version format --- hack/lib/version.sh | 6 +++--- hack/lib/windows/version.ps1 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hack/lib/version.sh b/hack/lib/version.sh index 263ba8f..c3427ec 100755 --- a/hack/lib/version.sh +++ b/hack/lib/version.sh @@ -68,9 +68,9 @@ function vox_box::version::get_version_vars() { # specify to 0.0.0 if the tree is dirty. if [[ "${GIT_TREE_STATE:-dirty}" == "dirty" ]]; then - GIT_VERSION="0.0.0" - elif ! [[ "${GIT_VERSION}" =~ ^([0-9]+)\.([0-9]+)(\.[0-9]+)?(-?[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then - GIT_VERSION="0.0.0" + GIT_VERSION="v0.0.0" + elif ! [[ "${GIT_VERSION}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then + GIT_VERSION="v0.0.0" fi # respect specified version diff --git a/hack/lib/windows/version.ps1 b/hack/lib/windows/version.ps1 index 4976e19..368c452 100755 --- a/hack/lib/windows/version.ps1 +++ b/hack/lib/windows/version.ps1 @@ -52,9 +52,9 @@ function Get-VoxBoxVersionVar { } } - # Set version to '0.0.0' if the tree is dirty or version format does not match - if ($GIT_TREE_STATE -eq "dirty" -or -not ($GIT_VERSION -match '^([0-9]+)\.([0-9]+)(\.[0-9]+)?(-?[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$')) { - $GIT_VERSION = "0.0.0" + # Set version to 'v0.0.0' if the tree is dirty or version format does not match + if ($GIT_TREE_STATE -eq "dirty" -or -not ($GIT_VERSION -match 'v([0-9]+)\.([0-9]+)(\.[0-9]+)?(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$')) { + $GIT_VERSION = "v0.0.0" } # Respect specified version