Skip to content

Commit

Permalink
fix: file path in powershell script
Browse files Browse the repository at this point in the history
Change location inside powershell does not affect the working dir
saw by .NET functions. Thus absolute path is needed.
  • Loading branch information
amorphobia committed Jan 4, 2025
1 parent ce2acc0 commit 296c684
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build/build-host-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,23 @@ $Version = $Version -replace '"'
$PackageReleasePath = "${PSScriptRoot}\release"
$PackageName = "shadowsocks-v${Version}.${TargetTriple}.zip"
$PackagePath = "${PackageReleasePath}\${PackageName}"
$ReleaseBuildPath = "${PSScriptRoot}\..\target\release"

Write-Host $Version
Write-Host $PackageReleasePath
Write-Host $PackageName
Write-Host $PackagePath
Write-Host $ReleaseBuildPath

Push-Location "${PSScriptRoot}\..\target\release"
Push-Location $ReleaseBuildPath

$ProgressPreference = "SilentlyContinue"
New-Item "${PackageReleasePath}" -ItemType Directory -ErrorAction SilentlyContinue
$CompressParam = @{
LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe", "ssservice.exe"
DestinationPath = "${PackagePath}"
}
if ([System.IO.File]::Exists("sswinservice.exe")) {
if ([System.IO.File]::Exists("$ReleaseBuildPath\sswinservice.exe")) {
$CompressParam.LiteralPath += "sswinservice.exe"
}
Compress-Archive @CompressParam
Expand All @@ -60,3 +62,5 @@ $PackageHash = (Get-FileHash -Path "${PackagePath}" -Algorithm SHA256).Hash
"${PackageHash} ${PackageName}" | Out-File -FilePath "${PackageChecksumPath}"

Write-Host "Created release packet checksum ${PackageChecksumPath}"

Pop-Location

0 comments on commit 296c684

Please sign in to comment.