Skip to content

Commit 8896f97

Browse files
authored
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
1 parent 9c6c5dc commit 8896f97

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/UpdateCheck.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,9 @@ end
7878

7979
ConPrintf("Checking for update...")
8080

81-
local scriptPath
82-
local runtimePath
83-
do
84-
local currentDir = io.popen("cd"):read() or io.popen("pwd"):read() or "."
85-
scriptPath = currentDir
86-
runtimePath = currentDir
87-
end
81+
-- Use built-in helpers to obtain absolute paths without spawning a shell.
82+
local scriptPath = (GetScriptPath and GetScriptPath()) or "."
83+
local runtimePath = (GetRuntimePath and GetRuntimePath()) or scriptPath
8884

8985
-- Load and process local manifest
9086
local localVer

0 commit comments

Comments
 (0)