diff --git a/bump.ps1 b/bump.ps1 index 71e6978..24f94fe 100644 --- a/bump.ps1 +++ b/bump.ps1 @@ -9,10 +9,10 @@ $version = $null try { - $version = $( git describe --tags --abbrev=0 ) + $version = $( git describe --tags --abbrev=0 ) -replace "v" if ($version -notmatch $versionPattern) { - Write-Error "Invalid version format. Expected: x.y.z" + Write-Error "Invalid version format $version. Expected: x.y.z" exit 1 } @@ -30,8 +30,8 @@ try Write-Host "New version: $newVersion" Write-Host "Creating new tag..." - git tag -a $newVersion -m "$message" - git push origin $newVersion + git tag -a v$newVersion -m "$message" + git push origin v$newVersion } catch { diff --git a/bump.sh b/bump.sh index 9288665..38aa268 100644 --- a/bump.sh +++ b/bump.sh @@ -9,6 +9,7 @@ version='' # Get the current version version=$(git describe --tags --abbrev=0 2>/dev/null) +version=${version//v} if [[ ! $version =~ $versionPattern ]]; then echo "Invalid version format. Expected: x.y.z" exit 1 @@ -30,5 +31,5 @@ echo "New version: $newVersion" echo "Creating new tag..." # Create a new tag and push it -git tag -a "$newVersion" -m "$message" -git push origin "$newVersion" +git tag -a "v$newVersion" -m "$message" +git push origin "v$newVersion"