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
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" }
gsudo {
Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue
Copy-Item ".\target\$Mode\rojo.exe" "C:\Program Files\Rojo\"
}
gsudo Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue
gsudo Copy-Item "$ExePath" "C:\Program Files\Rojo\"