Skip to content

Commit a7251a1

Browse files
🪲 [Fix]: Fix partial version on New-PSSemVer (#28)
## Description - Fix partial version on `New-PSSemVer` ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 76c2f65 commit a7251a1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/functions/public/New-PSSemVer.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@
7575
if ([string]::IsNullOrEmpty($Version)) {
7676
$Version = '0.0.0'
7777
}
78-
return [PSSemVer]::New($Version, $Prerelease, $BuildMetadata)
78+
$obj = [PSSemVer]::New($Version)
79+
if ($BuildMetadata) {
80+
$obj.SetBuildMetadata($BuildMetadata)
81+
}
82+
if ($Prerelease) {
83+
$obj.SetPrerelease($Prerelease)
84+
}
85+
return $obj
7986
}
8087
}
8188
}

0 commit comments

Comments
 (0)