Skip to content

Commit

Permalink
Refactor MongoDB CLI scripts to use environment variable for package …
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
Utesgui authored Apr 30, 2024
1 parent 6411ad6 commit e76df9a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Scripts/Update-MongoDB.MongoDBAtlasCLI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ $content = $website.Content
$links = $content | Select-String -Pattern 'https?://[^"]+' -AllMatches | % { $_.Matches } | % { $_.Value }
$msilinks = $links | Select-String -Pattern 'https?://[^\s]*\.msi' -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }

foreach ($wingetPackage in $PackageMapping.Keys){
$PackageFilter = $PackageMapping[$wingetPackage]
$Packagelinks = $msilinks | Select-String -Pattern "https?://[^\s]*$PackageFilter[^\s]*\.msi" -AllMatches | ForEach-Object { $_.Matches } | ForEach-Object { $_.Value }| Where-Object { $_ -notmatch "$PackageFilter-isolated|$PackageFilter-readonly" }
# Extract versions from the links
Expand Down Expand Up @@ -84,4 +83,4 @@ else {
Write-Output "No existing PRs found. Check why wingetcreate has not run."
}
}
}

2 changes: 1 addition & 1 deletion Scripts/Update-MongoDB.MongoDBCLI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $wingetPackage = ${Env:PackageName}
$url = ${Env:WebsiteURL}
$PackageFilter = ${Env:PackageFilter}

Write-Host "Try to update wingetPackage"
Write-Host "Try to update $wingetPackage"

# Download the webpage
$website = Invoke-WebRequest -Uri $url
Expand Down

0 comments on commit e76df9a

Please sign in to comment.