Fix flashing cmd window during update check (#8721)

* Fix flashing command prompt during update check

-use GetScriptPath and GetRuntimePath to assign vas in UpdateCheck.lua
-fixes flashing command prompt caused by io.popen
-fall back to "." if unable to determine paths

* Define scriptPath and runtimePath as local

-preserves original definition, prevents global namespace pollution
This commit is contained in:
Craig Citro
2025-06-25 20:33:10 -05:00
committed by GitHub
parent 9c6c5dcc88
commit 8896f97b0c

View File

@@ -78,13 +78,9 @@ end
ConPrintf("Checking for update...")
local scriptPath
local runtimePath
do
local currentDir = io.popen("cd"):read() or io.popen("pwd"):read() or "."
scriptPath = currentDir
runtimePath = currentDir
end
-- Use built-in helpers to obtain absolute paths without spawning a shell.
local scriptPath = (GetScriptPath and GetScriptPath()) or "."
local runtimePath = (GetRuntimePath and GetRuntimePath()) or scriptPath
-- Load and process local manifest
local localVer