Skip to content

Commit 437a3a9

Browse files
committed
- adds a script to automatically increment minor version
1 parent 7824c88 commit 437a3a9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/incrementMinorVersion.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Push-Location -Path (Join-Path -Path $PSScriptRoot -ChildPath "..")
2+
$versionFileContent = Get-Content -Path "msgraph/_version.py"
3+
$version = $versionFileContent -replace "VERSION: str = '", '' -replace "'", ''
4+
$versionParts = $version -split "\."
5+
$versionParts[1] = [int]$versionParts[1] + 1
6+
$versionParts[2] = 0
7+
$newVersion = $versionParts -join "."
8+
$versionFileContent -replace $version, $newVersion | Set-Content -Path "msgraph/_version.py" -NoNewline
9+
$pyprojectFileContent = Get-Content -Path "pyproject.toml" -Raw
10+
$pyprojectFileContent -replace $version, $newVersion | Set-Content -Path "pyproject.toml" -NoNewline
11+
Pop-Location

0 commit comments

Comments
 (0)