diff --git a/data/computercraft/lua/rom/programs/pkg.lua b/data/computercraft/lua/rom/programs/pkg.lua index adc3457..7b75f57 100644 --- a/data/computercraft/lua/rom/programs/pkg.lua +++ b/data/computercraft/lua/rom/programs/pkg.lua @@ -28,7 +28,7 @@ local pkg_config = { repo_url = "https://example.com/leonos/packages", -- 包仓库URL local_pkg_dir = "/packages", -- 本地包存储目录 installed_db = "/packages/installed.json", -- 已安装包数据库 - cache_dir = "/rom/cache" -- 缓存目录 + cache_dir = "/packages/cache" -- 缓存目录 } -- 确保必要的目录存在 diff --git a/installer.lua b/installer.lua index 0245f11..122dce7 100644 --- a/installer.lua +++ b/installer.lua @@ -145,6 +145,11 @@ end ok() bullet("Creating directories...") +-- 确保缓存目录存在 +local cache_dir = "/packages/cache" +if not fs.exists(cache_dir) then + fs.makeDir(cache_dir) +end for i=#to_dl, 1, -1 do local v = to_dl[i] if v.type == "tree" then