-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathdeploy-plugin.ps1
More file actions
57 lines (45 loc) · 1.75 KB
/
deploy-plugin.ps1
File metadata and controls
57 lines (45 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env pwsh
param(
[string]$DestinationPath = "C:\Program Files (x86)\Steam\steamapps\common\VoiceAttack 2\Apps\EliteAPI",
[switch]$SkipVoiceAttackRestart
)
# Detect if running on Windows
$IsWindowsOS = ($PSVersionTable.PSVersion.Major -lt 6) -or ($IsWindows -eq $true)
Write-Host "Stopping VoiceAttack..." -ForegroundColor Cyan
if (-not $SkipVoiceAttackRestart -and $IsWindowsOS) {
try {
Stop-Process -Name "VoiceAttack" -Force -ErrorAction SilentlyContinue
Write-Host "VoiceAttack stopped." -ForegroundColor Green
}
catch {
Write-Host "VoiceAttack was not running." -ForegroundColor Yellow
}
Start-Sleep -Seconds 2
}
Write-Host "`nBuilding plugin..." -ForegroundColor Cyan
dotnet restore
dotnet build --no-restore --configuration Release
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed!"
exit 1
}
Write-Host "`nCopying plugin files..." -ForegroundColor Cyan
# Create destination directory if it doesn't exist
if (-not (Test-Path $DestinationPath)) {
New-Item -ItemType Directory -Path $DestinationPath -Force | Out-Null
}
# Copy all items from build output to destination
$buildOutputPath = "EliteVA/bin/Release/net48/"
Copy-Item -Path "$buildOutputPath*" -Destination $DestinationPath -Force
Write-Host "Plugin deployed successfully." -ForegroundColor Green
if (-not $SkipVoiceAttackRestart -and $IsWindowsOS) {
Write-Host "`nStarting VoiceAttack..." -ForegroundColor Cyan
$voiceAttackExe = "C:\Program Files (x86)\Steam\steamapps\common\VoiceAttack 2\VoiceAttack.exe"
if (Test-Path $voiceAttackExe) {
Start-Process $voiceAttackExe
Write-Host "Done!" -ForegroundColor Green
}
else {
Write-Warning "VoiceAttack.exe not found at: $voiceAttackExe"
}
}