Skip to content

Commit

Permalink
fix packagename
Browse files Browse the repository at this point in the history
  • Loading branch information
Utesgui authored May 14, 2024
1 parent 40d7a2f commit da4d837
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Scripts/Test-Manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ Param(
)
$ManifestURL = $ManifestURL.TrimEnd('/')
$SplittedURL = $ManifestURL -split '/'
$package = "$($SplittedURL[-2]).$($SplittedURL[-3])"

# Define the regular expression to find values between a single lowercase char and the version number
$regex = '/([a-z])/(.*?)/([0-9.]*$)'

# Find all values between a single letter and the version number
if ($ManifestURL -match $regex) {
# Split the matched string by '/'
$package = ($Matches[2]).replace("/",".")
}
else {
$package = "$($SplittedURL[-2]).$($SplittedURL[-3])"
}


if (Test-Path -Path (Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'ManifestDownload')) {
Remove-Item -Path (Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'ManifestDownload') -Force -Recurse
}
Expand Down

0 comments on commit da4d837

Please sign in to comment.