Skip to content

Commit 2c5777c

Browse files
committed
fix(ci): correct powershell syntax for file removal
1 parent 022e2ab commit 2c5777c

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

.github/workflows/build-and-release.yml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -149,37 +149,26 @@ jobs:
149149
}
150150
}
151151
152-
# Remove unnecessary PowerToys DLLs that are provided by the host
153-
$unnecessaryDlls = @(
152+
# Remove unnecessary PowerToys DLLs and PDBs that are provided by the host
153+
$unnecessaryFiles = @(
154+
# DLLs
154155
"PowerToys.Common.UI.dll",
155-
"PowerToys.ManagedCommon.dll",
156+
"PowerToys.ManagedCommon.dll",
156157
"PowerToys.Settings.UI.Lib.dll",
157158
"Wox.Infrastructure.dll",
158-
"Wox.Plugin.dll"
159-
)
160-
161-
foreach ($dll in $unnecessaryDlls) {
162-
$dlls = Get-ChildItem -Path "$artifactDir/RandomGen" -Recurse | Where-Object { $_.Name -in $unnecessaryDlls }
163-
if ($dlls) {
164-
foreach ($item in $dlls) {
165-
Write-Host "Removing unnecessary DLL: $($item.FullName)"
166-
Remove-Item $item.FullName -Force
167-
}
168-
}
169-
170-
# Remove unnecessary PowerToys PDB files that are not needed for release
171-
$unnecessaryPdbs = @(
159+
"Wox.Plugin.dll",
160+
# PDBs
172161
"PowerToys.Common.UI.pdb",
173162
"PowerToys.ManagedCommon.pdb",
174163
"PowerToys.Settings.UI.Lib.pdb",
175164
"Wox.Infrastructure.pdb",
176165
"Wox.Plugin.pdb"
177166
)
178167
179-
$pdbs = Get-ChildItem -Path "$artifactDir/RandomGen" -Recurse | Where-Object { $_.Name -in $unnecessaryPdbs }
180-
if ($pdbs) {
181-
foreach ($item in $pdbs) {
182-
Write-Host "Removing unnecessary PDB: $($item.FullName)"
168+
$filesToRemove = Get-ChildItem -Path "$artifactDir/RandomGen" -Recurse | Where-Object { $_.Name -in $unnecessaryFiles }
169+
if ($filesToRemove) {
170+
foreach ($item in $filesToRemove) {
171+
Write-Host "Removing unnecessary file: $($item.FullName)"
183172
Remove-Item $item.FullName -Force
184173
}
185174
}

0 commit comments

Comments
 (0)