Skip to content

Commit bea31b0

Browse files
authored
Merge pull request #202 from Z-bit-Systems-LLC/develop
Fix version script errors
2 parents 0018395 + 82f9242 commit bea31b0

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

scripts/Get-Version.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717

1818
param(
1919
[Parameter(Mandatory = $false)]
20-
[string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props"),
21-
20+
[string]$BuildPropsPath,
21+
2222
[Parameter(Mandatory = $false)]
2323
[ValidateSet("Simple", "Detailed")]
2424
[string]$Format = "Detailed"
2525
)
2626

27+
# Set default path if not provided
28+
if (-not $BuildPropsPath) {
29+
$BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props"
30+
}
31+
2732
function Get-Version {
2833
param([string]$FilePath)
2934

scripts/Increment-Version.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ param(
2121
[Parameter(Mandatory = $false)]
2222
[ValidateSet("Major", "Minor", "Patch")]
2323
[string]$IncrementType = "Patch",
24-
24+
2525
[Parameter(Mandatory = $false)]
26-
[string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props")
26+
[string]$BuildPropsPath
2727
)
2828

29+
# Set default path if not provided
30+
if (-not $BuildPropsPath) {
31+
$BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props"
32+
}
33+
2934
function Get-CurrentVersion {
3035
param([string]$FilePath)
3136

scripts/Set-Version.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,16 @@
1818
param(
1919
[Parameter(Mandatory = $true)]
2020
[string]$Version,
21-
21+
2222
[Parameter(Mandatory = $false)]
23-
[string]$BuildPropsPath = (Join-Path $PSScriptRoot ".." "Directory.Build.props")
23+
[string]$BuildPropsPath
2424
)
2525

26+
# Set default path if not provided
27+
if (-not $BuildPropsPath) {
28+
$BuildPropsPath = Join-Path $PSScriptRoot ".." "Directory.Build.props"
29+
}
30+
2631
function Validate-Version {
2732
param([string]$Version)
2833

0 commit comments

Comments
 (0)