can copy out mod packs now
This commit is contained in:
@@ -59,4 +59,4 @@ I will complain about it.
|
|||||||
- [x] Make some kind of JSON format / script to copy out specific mods for
|
- [x] Make some kind of JSON format / script to copy out specific mods for
|
||||||
specific saves.
|
specific saves.
|
||||||
- [ ] Function to open ContentDB for each mod in a list, or just a specific mod.
|
- [ ] Function to open ContentDB for each mod in a list, or just a specific mod.
|
||||||
- [ ] Function to copy mods to a particular destination based on a pack.
|
- [x] Function to copy mods to a particular destination based on a pack.
|
||||||
|
|||||||
+16
-3
@@ -4,6 +4,19 @@ local utility = require "utility"
|
|||||||
|
|
||||||
local data = utility.load_data("info.json")
|
local data = utility.load_data("info.json")
|
||||||
|
|
||||||
|
local copy_pack_mods = function(pack_name, destination_path)
|
||||||
|
os.execute("mkdir -p " .. destination_path:enquote())
|
||||||
|
|
||||||
|
local pack_mods = data.packs[pack_name].mods
|
||||||
|
|
||||||
|
for mod_name in pairs(pack_mods) do
|
||||||
|
local source = ("mods" .. utility.path_separator .. mod_name):enquote()
|
||||||
|
local target = (destination_path .. utility.path_separator .. mod_name):enquote()
|
||||||
|
|
||||||
|
os.execute("cp -r " .. source .. " " .. target)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local check_dependencies = function(pack_name)
|
local check_dependencies = function(pack_name)
|
||||||
local pack_mods = data.packs[pack_name].mods
|
local pack_mods = data.packs[pack_name].mods
|
||||||
|
|
||||||
@@ -58,7 +71,7 @@ local standardize_data = function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
check_dependencies("Unnamed Luanti TechAge Pack")
|
copy_pack_mods("Unnamed Luanti TechAge Pack", "../Luanti_Servers/mods")
|
||||||
|
|
||||||
standardize_data()
|
-- standardize_data()
|
||||||
utility.save_data(data)
|
-- utility.save_data(data)
|
||||||
|
|||||||
Reference in New Issue
Block a user