From b0d7c404a04496bc09d0be2b65983bdd6f7a93fe Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 2 Oct 2022 13:34:25 +0100 Subject: [PATCH] Make Set-AppVersion auto-increment version Former-commit-id: bf24b2787577b6b16a5d199365dbc6100cf1026e Former-commit-id: 6bdde8982bf424d78742ccbf417c12466ca52ae2 --- scripts/Set-AppVersion.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/Set-AppVersion.ps1 b/scripts/Set-AppVersion.ps1 index 7513ed25..c27d6b00 100644 --- a/scripts/Set-AppVersion.ps1 +++ b/scripts/Set-AppVersion.ps1 @@ -14,6 +14,14 @@ if ($customversion) { if ($init_params -match 'params\[[''"]appVersion[''"]]\s*=\s*[''"]([^''"]+)') { $file_tag = 'v' + $matches[1] } + if ($file_tag) { + "`nCurrent app version is: $file_tag" + if ($file_tag -match '(^.*\.)([0-9]+)(.*$)') { + if ($matches[2]) { + $file_tag = $matches[1] + ($matches[2] / 1 + 1) + $matches[3] + } + } + } $tag_name = Read-Host "`nEnter the tag name for this release, Enter to accept suggested tag [$file_tag]" if ($tag_name -eq "") { $tag_name = $file_tag } if ($tag_name -NotMatch '^v\d+\.\d+\.\d+([+EN-]|$)') {