Refactor configuration loading to use dynamic base directory path

This commit is contained in:
MayaTheShy
2026-03-22 16:07:25 -04:00
parent 63e28d9126
commit 3095fc7387

View File

@@ -24,14 +24,17 @@ local DROPPER_ANNOUNCE_INTERVAL = 30 -- seconds between dropper announcements
-- Load config from file if present -- Load config from file if present
------------------------------------------------- -------------------------------------------------
local CLIENT_CONFIG_FILE = ".client_config" local _baseDir = fs.getDir(shell.getRunningProgram())
local function _path(rel) return fs.combine(_baseDir, rel) end
local CLIENT_CONFIG_FILE = _path(".client_config")
------------------------------------------------- -------------------------------------------------
-- Shared UI helpers (loaded early for config use) -- Shared UI helpers (loaded early for config use)
------------------------------------------------- -------------------------------------------------
local ui = dofile("lib/ui.lua") local ui = dofile(_path("lib/ui.lua"))
local log = dofile("lib/log.lua") local log = dofile(_path("lib/log.lua"))
local function loadConfig() local function loadConfig()
if not fs.exists(CLIENT_CONFIG_FILE) then return end if not fs.exists(CLIENT_CONFIG_FILE) then return end