Refactor Windows install script to streamline executable path handling and improve readability. Updated the path variable for the executable and simplified the gsudo commands for stopping the process and copying the executable.

This commit is contained in:
Joe 2025-12-20 20:59:10 -06:00
parent 83bbf0ef6b
commit cc7d2e3848

View file

@ -4,9 +4,8 @@ param([string]$Mode = "release")
Set-Location $PSScriptRoot Set-Location $PSScriptRoot
cargo build "--$Mode" cargo build "--$Mode"
& ".\target\$Mode\rojo.exe" build plugin.project.json --plugin Rojo.rbxm $ExePath = ".\target\$Mode\rojo.exe"
& "$ExePath" build plugin.project.json --plugin Rojo.rbxm
if ($LASTEXITCODE -ne 0) { throw "Plugin build failed" } if ($LASTEXITCODE -ne 0) { throw "Plugin build failed" }
gsudo { gsudo Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue
Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue gsudo Copy-Item "$ExePath" "C:\Program Files\Rojo\"
Copy-Item ".\target\$Mode\rojo.exe" "C:\Program Files\Rojo\"
}