-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Include PowerShell dependency in winget manifest (v3) #1557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -41,4 +41,26 @@ jobs: | |||||
| .\wingetcreate.exe update $packageId ` | ||||||
| --version $packageVersion ` | ||||||
| --urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" ` | ||||||
| --submit | ||||||
| --out manifests | ||||||
|
|
||||||
| # Add PowerShell dependency to installer manifest | ||||||
| $installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName | ||||||
| if (-not $installerManifest) { | ||||||
| Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory." | ||||||
| exit 1 | ||||||
| } | ||||||
| $content = Get-Content -Path $installerManifest -Raw | ||||||
| $dependency = @" | ||||||
| Dependencies: | ||||||
| PackageDependencies: | ||||||
| - PackageIdentifier: Microsoft.PowerShell | ||||||
| MinimumVersion: "7.0.0" | ||||||
| "@ | ||||||
| # Remove existing top-level Dependencies block (if any), then insert ours | ||||||
| $content = $content -replace '(?m)^Dependencies:\r?\n([ ]+.+\r?\n)*', '' | ||||||
| $content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:" | ||||||
| Set-Content -Path $installerManifest -Value $content | ||||||
|
||||||
| Set-Content -Path $installerManifest -Value $content | |
| Set-Content -Path $installerManifest -Value $content -Encoding utf8 |
Uh oh!
There was an error while loading. Please reload this page.