mirror of https://github.com/ospab/ostp.git
Fix: Resolve WSL path escaping bug and enforce distribution cleanup in build.ps1
This commit is contained in:
parent
a107f74b8d
commit
cbb4486514
|
|
@ -15,6 +15,10 @@ $LinuxDist = Join-Path $DistDir "linux"
|
||||||
New-Item -ItemType Directory -Force -Path $WinDist | Out-Null
|
New-Item -ItemType Directory -Force -Path $WinDist | Out-Null
|
||||||
New-Item -ItemType Directory -Force -Path $LinuxDist | Out-Null
|
New-Item -ItemType Directory -Force -Path $LinuxDist | Out-Null
|
||||||
|
|
||||||
|
# Clear old binaries to prevent false positive checks if copy fails
|
||||||
|
Remove-Item -Path (Join-Path $WinDist "ostp.exe") -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
Remove-Item -Path (Join-Path $LinuxDist "ostp") -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
Write-Output "Building Windows Binary natively"
|
Write-Output "Building Windows Binary natively"
|
||||||
$TempTarget = Join-Path $env:TEMP "ostp_target_build"
|
$TempTarget = Join-Path $env:TEMP "ostp_target_build"
|
||||||
$env:CARGO_TARGET_DIR = $TempTarget
|
$env:CARGO_TARGET_DIR = $TempTarget
|
||||||
|
|
@ -51,8 +55,10 @@ if (Get-Command wsl -ErrorAction SilentlyContinue) {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Fix Windows backslashes for WSL path translator passing
|
||||||
|
$LinuxDistUnix = $LinuxDist.Replace("\", "/")
|
||||||
# Determine WSL translation of the destination folder
|
# Determine WSL translation of the destination folder
|
||||||
$WslLinuxDist = & wsl wslpath -u $LinuxDist
|
$WslLinuxDist = & wsl wslpath -u $LinuxDistUnix
|
||||||
# Copy from WSL temp directory into the actual host mapped linux dist
|
# Copy from WSL temp directory into the actual host mapped linux dist
|
||||||
& wsl cp /tmp/ostp_linux_build/x86_64-unknown-linux-musl/release/ostp $WslLinuxDist/ostp
|
& wsl cp /tmp/ostp_linux_build/x86_64-unknown-linux-musl/release/ostp $WslLinuxDist/ostp
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue