fix(lib): error while attempting to migrate when new dir exists

This commit is contained in:
Erica Marigold 2024-12-22 15:59:27 +00:00
parent 76e434ec6d
commit 773cc1b2a1
Signed by: DevComp
GPG key ID: 429EF1C337871656

View file

@ -91,7 +91,8 @@ local LINK_INSTALL_DIR = (dirs.homeDir() or error("Couldn't get home dir :(")):j
local TOOL_STORAGE_DIR = LINK_INSTALL_DIR:join(".tool_storage")
local OLD_TOOL_STORAGE_DIR = LINK_INSTALL_DIR:join("tool_storage")
if pathfs.isDir(OLD_TOOL_STORAGE_DIR) then
if pathfs.isDir(OLD_TOOL_STORAGE_DIR) and not pathfs.isDir(TOOL_STORAGE_DIR) then
-- TODO: Merge both directories into one instead of a single move
pathfs.move(OLD_TOOL_STORAGE_DIR, TOOL_STORAGE_DIR)
end