Skip to content

Commit

Permalink
Split cachedir from userdir.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamharrison committed Jan 11, 2025
1 parent 34c2398 commit ffcc5cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lpm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,6 @@ end
local DEFAULT_REPOS
function lpm.repo_init(repos)
DEFAULT_REPOS = { Repository.url(DEFAULT_REPO_URL) }
common.mkdirp(CACHEDIR)
if not system.stat(CACHEDIR .. PATHSEP .. "settings.json") then
for i, repository in ipairs(repos or DEFAULT_REPOS) do
table.insert(repositories, repository:add(true))
Expand Down Expand Up @@ -2748,7 +2747,7 @@ not commonly used publically.
USERDIR = common.normalize_path(ARGS["userdir"]) or os.getenv("LITE_USERDIR") or (os.getenv("XDG_CONFIG_HOME") and os.getenv("XDG_CONFIG_HOME") .. PATHSEP .. "lite-xl")
or (HOME and (HOME .. PATHSEP .. '.config' .. PATHSEP .. 'lite-xl'))
AUTO_PULL_REMOTES = ARGS["remotes"]
CACHEDIR = common.normalize_path(ARGS["cachedir"]) or os.getenv("LPM_CACHE") or USERDIR .. PATHSEP .. "lpm"
CACHEDIR = common.normalize_path(ARGS["cachedir"]) or os.getenv("LPM_CACHE") or (HOME .. PATHSEP .. ".cache" .. PATHSEP .. "lpm")
TMPDIR = common.normalize_path(ARGS["tmpdir"]) or CACHEDIR .. PATHSEP .. "tmp"
if ARGS["trace"] then system.trace(true) end

Expand Down Expand Up @@ -2959,6 +2958,7 @@ not commonly used publically.
end

if not system.stat(USERDIR) then common.mkdirp(USERDIR) end
if not system.stat(CACHEDIR) then common.mkdirp(CACHEDIR) end
if engage_locks(function()
lpm.setup()
end, error_handler, lock_warning) then return end
Expand Down

0 comments on commit ffcc5cb

Please sign in to comment.