Skip to content

Commit d162399

Browse files
Address CR feedback: add error handling and fix newline
- Add check for missing installer manifest with error message - Remove -NoNewline to preserve YAML file conventions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8d7e467 commit d162399

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/winget.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ jobs:
4444
--out manifests
4545
4646
# Add PowerShell dependency to installer manifest
47-
$installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1
48-
$content = Get-Content $installerManifest -Raw
47+
$installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName
48+
if (-not $installerManifest) {
49+
Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory."
50+
exit 1
51+
}
52+
$content = Get-Content -Path $installerManifest -Raw
4953
$dependency = @"
5054
Dependencies:
5155
PackageDependencies:
@@ -54,7 +58,7 @@ Dependencies:
5458
"@
5559
# Insert dependency block before the Installers section
5660
$content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:"
57-
Set-Content -Path $installerManifest -Value $content -NoNewline
61+
Set-Content -Path $installerManifest -Value $content
5862

5963
# Submit the modified manifest
6064
.\wingetcreate.exe submit manifests

0 commit comments

Comments
 (0)