mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
21 lines
732 B
PowerShell
21 lines
732 B
PowerShell
#Requires -Version 5.1
|
|
|
|
param([string]$Mode = "release")
|
|
|
|
$InstallDir = "C:\Program Files\Rojo"
|
|
|
|
Set-Location $PSScriptRoot
|
|
cargo build "--$Mode"
|
|
$Rojo = ".\target\$Mode\rojo.exe"
|
|
& "$Rojo" build plugin.project.json --plugin Rojo.rbxm
|
|
if ($LASTEXITCODE -ne 0) { throw "Plugin build failed" }
|
|
|
|
gsudo Stop-Process -Name "rojo" -Force -ErrorAction SilentlyContinue
|
|
gsudo New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
|
|
gsudo Copy-Item "$Rojo" "$InstallDir\"
|
|
|
|
$MachinePath = [Environment]::GetEnvironmentVariable("Path", "Machine")
|
|
if ($MachinePath -notlike "*$InstallDir*") {
|
|
gsudo [Environment]::SetEnvironmentVariable "Path" "$MachinePath;$InstallDir" "Machine"
|
|
Write-Host "Added '$InstallDir' to system PATH"
|
|
}
|