Skip to content

Commit f26d563

Browse files
committed
use powershell and revert change in post_build.ps1
1 parent 2868c72 commit f26d563

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: Test
5252
run: dotnet test --no-build --verbosity normal -c Release
5353
- name: Perform post_build tasks
54-
shell: pwsh
54+
shell: powershell
5555
run: .\Scripts\post_build.ps1
5656
- name: Upload Plugin Nupkg
5757
uses: actions/upload-artifact@v4

Scripts/post_build.ps1

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
param(
2-
[string]$config = "Release",
2+
[string]$config = "Release",
33
[string]$solution = (Join-Path $PSScriptRoot ".." -Resolve)
44
)
55
Write-Host "Config: $config"
@@ -40,13 +40,11 @@ function Delete-Unused ($path, $config) {
4040
$target = "$path\Output\$config"
4141
$included = Get-ChildItem $target -Filter "*.dll"
4242
foreach ($i in $included){
43-
foreach ($plugin in Get-ChildItem $target\Plugins){
44-
$deleteList = Get-ChildItem $plugin -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name }
45-
$deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
46-
$deleteList | Remove-Item
47-
}
43+
$deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" }
44+
$deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName }
45+
$deleteList | Remove-Item
4846
}
49-
Remove-Item -Path $target -Include "*.xml" -Recurse
47+
Remove-Item -Path $target -Include "*.xml" -Recurse
5048
}
5149

5250
function Remove-CreateDumpExe ($path, $config) {
@@ -89,7 +87,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) {
8987
Squirrel --releasify $nupkg --releaseDir $temp --setupIcon $icon --no-msi | Write-Output
9088
Move-Item $temp\* $output -Force
9189
Remove-Item $temp
92-
90+
9391
$file = "$output\Flow-Launcher-Setup.exe"
9492
Write-Host "Filename: $file"
9593

@@ -109,7 +107,7 @@ function Publish-Self-Contained ($p) {
109107
}
110108

111109
function Publish-Portable ($outputLocation, $version) {
112-
110+
113111
& $outputLocation\Flow-Launcher-Setup.exe --silent | Out-Null
114112
mkdir "$env:LocalAppData\FlowLauncher\app-$version\UserData"
115113
Compress-Archive -Path $env:LocalAppData\FlowLauncher -DestinationPath $outputLocation\Flow-Launcher-Portable.zip
@@ -121,7 +119,7 @@ function Main {
121119
Copy-Resources $p
122120

123121
if ($config -eq "Release"){
124-
122+
125123
Delete-Unused $p $config
126124

127125
Publish-Self-Contained $p
@@ -136,4 +134,4 @@ function Main {
136134
}
137135
}
138136

139-
Main
137+
Main

0 commit comments

Comments
 (0)