Refactor turtle configuration loading to use dynamic base directory path
This commit is contained in:
@@ -19,7 +19,10 @@ local CRAFT_SLOTS = {1, 2, 3, 5, 6, 7, 9, 10, 11}
|
|||||||
-- Load config from file if present
|
-- 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()
|
local function loadConfig()
|
||||||
if not fs.exists(TURTLE_CONFIG_FILE) then return end
|
if not fs.exists(TURTLE_CONFIG_FILE) then return end
|
||||||
|
|||||||
Reference in New Issue
Block a user