adapt: adapt to GMLIB v0.13.8
This commit is contained in:
@@ -82,16 +82,16 @@ function string_formatter(str, variables)
|
||||
end)
|
||||
end
|
||||
|
||||
function pack_plugin(target,plugin_define)
|
||||
function pack_mod(target,mod_define)
|
||||
import("lib.detect.find_file")
|
||||
|
||||
local manifest_path = find_file("manifest.json", os.projectdir())
|
||||
if manifest_path then
|
||||
local manifest = io.readfile(manifest_path)
|
||||
local bindir = path.join(os.projectdir(), "bin")
|
||||
local outputdir = path.join(bindir, plugin_define.pluginName)
|
||||
local targetfile = path.join(outputdir, plugin_define.pluginFile)
|
||||
local pdbfile = path.join(outputdir, path.basename(plugin_define.pluginFile) .. ".pdb")
|
||||
local outputdir = path.join(bindir, mod_define.modName)
|
||||
local targetfile = path.join(outputdir, mod_define.modFile)
|
||||
local pdbfile = path.join(outputdir, path.basename(mod_define.modFile) .. ".pdb")
|
||||
local manifestfile = path.join(outputdir, "manifest.json")
|
||||
local oritargetfile = target:targetfile()
|
||||
local oripdbfile = path.join(path.directory(oritargetfile), path.basename(oritargetfile) .. ".pdb")
|
||||
@@ -102,9 +102,9 @@ function pack_plugin(target,plugin_define)
|
||||
os.cp(oripdbfile, pdbfile)
|
||||
end
|
||||
|
||||
formattedmanifest = string_formatter(manifest, plugin_define)
|
||||
formattedmanifest = string_formatter(manifest, mod_define)
|
||||
io.writefile(manifestfile,formattedmanifest)
|
||||
cprint("${bright green}[Plugin Packer]: ${reset}plugin already generated to " .. outputdir)
|
||||
cprint("${bright green}[Mod Packer]: ${reset}mod already generated to " .. outputdir)
|
||||
else
|
||||
cprint("${bright yellow}warn: ${reset}not found manifest.json in root dir!")
|
||||
end
|
||||
@@ -112,7 +112,7 @@ end
|
||||
|
||||
|
||||
return {
|
||||
pack_plugin = pack_plugin,
|
||||
pack_mod = pack_mod,
|
||||
beautify_json = beautify_json,
|
||||
string_formatter = string_formatter
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user