mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
- Updated `install.ps1` to include execution of the vscode-rojo installation script. - Modified `install.sh` to change directory and run the vscode-rojo installation script, ensuring proper setup during installation.
30 lines
997 B
PowerShell
30 lines
997 B
PowerShell
#Requires -Version 5.1
|
|
|
|
param([string]$Mode = "release")
|
|
|
|
$InstallDir = "C:\Program Files\Atlas"
|
|
|
|
Set-Location $PSScriptRoot
|
|
if ($Mode -eq "release") {
|
|
cargo build --release --config "profile.release.debug=true"
|
|
} else {
|
|
cargo build "--$Mode"
|
|
}
|
|
$Atlas = ".\target\$Mode\atlas.exe"
|
|
& "$Atlas" build plugin.project.json --plugin Atlas.rbxm
|
|
if ($LASTEXITCODE -ne 0) { throw "Plugin build failed" }
|
|
|
|
gsudo Stop-Process -Name "atlas" -Force -ErrorAction SilentlyContinue
|
|
gsudo New-Item -ItemType Directory -Path $InstallDir -Force | Out-Null
|
|
gsudo Copy-Item "$Atlas" "$InstallDir\"
|
|
gsudo Copy-Item ".\target\$Mode\atlas.pdb" "$InstallDir\"
|
|
|
|
$MachinePath = [Environment]::GetEnvironmentVariable("Path", "Machine")
|
|
if ($MachinePath -notlike "*$InstallDir*") {
|
|
gsudo [Environment]::SetEnvironmentVariable "Path" "$MachinePath;$InstallDir" "Machine"
|
|
Write-Host "Added '$InstallDir' to system PATH"
|
|
}
|
|
|
|
Push-Location "$PSScriptRoot\vscode-rojo"
|
|
& "$PSScriptRoot\vscode-rojo\install.ps1"
|
|
Pop-Location
|