Skip to content

Commit b53c222

Browse files
committed
Refactor Vextpack injection and RMLevelLoaderGen script execution for improved error handling and clarity
1 parent c1a6368 commit b53c222

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,13 @@ jobs:
4747
$Dest = "node_modules\vextpack"
4848
4949
if (Test-Path $Source) {
50-
Write-Host "Injecting vextpack from $Source to $Dest"
5150
Copy-Item -Path $Source -Destination $Dest -Recurse -Force
52-
} else {
53-
Write-Warning "vextpack folder not found at root! Skipping injection."
5451
}
5552
5653
pnpm build
5754
58-
if (Test-Path "..\ui.vuic") {
59-
Write-Host "SUCCESS: ui.vuic found in RealityMod root."
60-
} else {
55+
if (-not (Test-Path "..\ui.vuic")) {
6156
Write-Error "FAILURE: ui.vuic was not found in ../ui.vuic!"
62-
# Debugging: List files in parent dir to see what happened
63-
Get-ChildItem -Path ".." | Select-Object Name
6457
exit 1
6558
}
6659
@@ -71,12 +64,22 @@ jobs:
7164
run: |
7265
git clone https://oauth2:$env:GH_TOKEN@github.com/BF3RM/RMLevelLoaderGen.git temp_loader
7366
cd temp_loader
74-
.\generate.bat
7567
76-
if (Test-Path "mods\rm-levelloader") {
77-
Move-Item -Path "mods\rm-levelloader" -Destination "..\Build\Admin\Mods\rm-levelloader"
68+
(Get-Content generate.bat) -replace 'pause', 'REM pause' | Set-Content generate.bat
69+
70+
cmd /c "echo. | generate.bat"
71+
72+
$LocalPath = "mods\rm-levelloader"
73+
$DocPath = "$env:USERPROFILE\Documents\Battlefield 3\Server\Admin\Mods\RMLevelLoaderGen\mods\rm-levelloader"
74+
$Dest = "..\Build\Admin\Mods\rm-levelloader"
75+
76+
if (Test-Path $LocalPath) {
77+
Move-Item -Path $LocalPath -Destination $Dest -Force
78+
} elseif (Test-Path $DocPath) {
79+
Move-Item -Path $DocPath -Destination $Dest -Force
7880
} else {
7981
Write-Error "Could not find generated rm-levelloader folder."
82+
exit 1
8083
}
8184
8285
- name: Generate Config Files
@@ -107,9 +110,7 @@ jobs:
107110
$startupContent = @"
108111
# RM Server Startup.txt Example
109112
110-
# RCON Password
111113
admin.password "$env:RCON_PW"
112-
# Game Password
113114
vars.gamePassword "password"
114115
115116
# Server
@@ -151,4 +152,4 @@ jobs:
151152
uses: actions/upload-artifact@v4
152153
with:
153154
name: BF3-Server-Files
154-
path: Build/
155+
path: Build/

0 commit comments

Comments
 (0)