From 3095fc7387a6a76a9a87ffdc200660a70c7f809b Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 22 Mar 2026 16:07:25 -0400 Subject: [PATCH] Refactor configuration loading to use dynamic base directory path --- inventoryClient.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/inventoryClient.lua b/inventoryClient.lua index c8a3441..9375b58 100644 --- a/inventoryClient.lua +++ b/inventoryClient.lua @@ -24,14 +24,17 @@ local DROPPER_ANNOUNCE_INTERVAL = 30 -- seconds between dropper announcements -- 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) ------------------------------------------------- -local ui = dofile("lib/ui.lua") -local log = dofile("lib/log.lua") +local ui = dofile(_path("lib/ui.lua")) +local log = dofile(_path("lib/log.lua")) local function loadConfig() if not fs.exists(CLIENT_CONFIG_FILE) then return end