Skip to content

Commit d7cb6fc

Browse files
Merge pull request chocolatey#155 from ryanrichter94/QSG-154
(chocolatey#154) Update License Package Script Versioning
2 parents 1e1a33c + 176d511 commit d7cb6fc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/Create-ChocoLicensePkg.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ Write-Warning "This script will OVERWRITE any existing license file you might ha
5050
& choco | Out-String -Stream | Write-Host
5151
Write-Warning "If there is is a note about invalid license above, you're going to run into issues."
5252

53+
# Get license expiration date and node count
5354
[xml]$licenseXml = Get-Content -Path $LicensePath
5455
$licenseExpiration = [datetimeoffset]::Parse("$($licenseXml.SelectSingleNode('/license').expiration) +0")
56+
$null = $licenseXml.license.name -match "(?<=\[).*(?=\])"
57+
$licenseNodeCount = $Matches.Values -replace '\s[A-Za-z]+',''
5558

5659
if ($licenseExpiration -lt [datetimeoffset]::UtcNow) {
5760
Write-Warning "THE LICENSE FILE AT '$LicensePath' is EXPIRED. This is the file used by this script to generate this package, not at '$licensePackageFolder'"
@@ -60,7 +63,7 @@ if ($licenseExpiration -lt [datetimeoffset]::UtcNow) {
6063
}
6164

6265
if (-not $LicensePackageVersion) {
63-
$LicensePackageVersion = $licenseExpiration | Get-Date -Format 'yyyy.MM.dd'
66+
$LicensePackageVersion = ($licenseExpiration | Get-Date -Format 'yyyy.MM.dd') + '.' + "$licenseNodeCount"
6467
}
6568

6669
# Ensure the packaging folder exists

0 commit comments

Comments
 (0)