From 63e28d912633d53d10c1d114d881b5d31917732a Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sun, 22 Mar 2026 16:07:20 -0400 Subject: [PATCH] Refactor turtle configuration loading to use dynamic base directory path --- craftingTurtle.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/craftingTurtle.lua b/craftingTurtle.lua index cf8a8e1..613db6d 100644 --- a/craftingTurtle.lua +++ b/craftingTurtle.lua @@ -19,7 +19,10 @@ local CRAFT_SLOTS = {1, 2, 3, 5, 6, 7, 9, 10, 11} -- Load config from file if present ------------------------------------------------- -local TURTLE_CONFIG_FILE = ".turtle_config" +local _baseDir = fs.getDir(shell.getRunningProgram()) +local function _path(rel) return fs.combine(_baseDir, rel) end + +local TURTLE_CONFIG_FILE = _path(".turtle_config") local function loadConfig() if not fs.exists(TURTLE_CONFIG_FILE) then return end