summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-09-19 18:16:53 +0200
committersfan5 <sfan5@live.de>2021-10-07 00:20:01 +0200
commit6de8d77e17017cd5cc7b065d42566b6b1cd076cc (patch)
tree1a6fc291b4df620a4b3c09182b0a69c9b42d2036 /builtin
parent2b5075f0e2a8223cdb07f000b7e8f874416ed3a8 (diff)
downloadminetest-6de8d77e17017cd5cc7b065d42566b6b1cd076cc.tar.gz
minetest-6de8d77e17017cd5cc7b065d42566b6b1cd076cc.tar.bz2
minetest-6de8d77e17017cd5cc7b065d42566b6b1cd076cc.zip
Move instead of copy during content install if possible
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/pkgmgr.lua8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin/mainmenu/pkgmgr.lua b/builtin/mainmenu/pkgmgr.lua
index d07dc019c..e83a93c91 100644
--- a/builtin/mainmenu/pkgmgr.lua
+++ b/builtin/mainmenu/pkgmgr.lua
@@ -546,11 +546,10 @@ function pkgmgr.install_dir(type, path, basename, targetpath)
local from = basefolder and basefolder.path or path
if targetpath then
core.delete_dir(targetpath)
- core.create_dir(targetpath)
else
targetpath = core.get_texturepath() .. DIR_DELIM .. basename
end
- if not core.copy_dir(from, targetpath) then
+ if not core.copy_dir(from, targetpath, false) then
return nil,
fgettext("Failed to install $1 to $2", basename, targetpath)
end
@@ -571,7 +570,6 @@ function pkgmgr.install_dir(type, path, basename, targetpath)
-- Get destination name for modpack
if targetpath then
core.delete_dir(targetpath)
- core.create_dir(targetpath)
else
local clean_path = nil
if basename ~= nil then
@@ -595,7 +593,6 @@ function pkgmgr.install_dir(type, path, basename, targetpath)
if targetpath then
core.delete_dir(targetpath)
- core.create_dir(targetpath)
else
local targetfolder = basename
if targetfolder == nil then
@@ -621,14 +618,13 @@ function pkgmgr.install_dir(type, path, basename, targetpath)
if targetpath then
core.delete_dir(targetpath)
- core.create_dir(targetpath)
else
targetpath = core.get_gamepath() .. DIR_DELIM .. basename
end
end
-- Copy it
- if not core.copy_dir(basefolder.path, targetpath) then
+ if not core.copy_dir(basefolder.path, targetpath, false) then
return nil,
fgettext("Failed to install $1 to $2", basename, targetpath)
end