add multifile thing?
This commit is contained in:
parent
94e6615afc
commit
58b39788f3
22
multifile/lib/multifile.lua
Normal file
22
multifile/lib/multifile.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local mfs=dofile "/lib/mfs.lua"
|
||||
local res={}
|
||||
|
||||
function res.pack(filename,pf)
|
||||
if not pf then
|
||||
pf=filename
|
||||
filename=""
|
||||
end
|
||||
local res2=""
|
||||
if mfs.type(pf.."/"..filename)=="directory" then
|
||||
res2=res2.."if not fs.exists('"..filename.."') then fs.makeDir('"..filename.."') end "
|
||||
local l=fs.list(pf.."/"..filename)
|
||||
for i,v in ipairs(l) do
|
||||
res2=res2..res.pack(filename.."/"..v,pf)
|
||||
end
|
||||
else
|
||||
res2=res2.."f=fs.open('"..filename.."','w') f.write("..("%q"):format(mfs.read(pf.."/"..filename))..") f.close() "
|
||||
end
|
||||
return res2
|
||||
end
|
||||
|
||||
return res
|
12
multifile/pkgmeta.ltn
Normal file
12
multifile/pkgmeta.ltn
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
["version"] = "0.1.0",
|
||||
["dependencies"] = {
|
||||
"mfs",
|
||||
},
|
||||
["description"] = "Packs multiple files into one. Currently only a library",
|
||||
["files"] = {
|
||||
["lib"] = {
|
||||
"multifile.lua"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user