diff --git a/Applications.txt b/Applications.txt index ee7f8ecb..aaf85754 100644 --- a/Applications.txt +++ b/Applications.txt @@ -378,7 +378,7 @@ name="lib/compressor.lua", url="IgorTimofeev/OpenComputers/master/lib/compressor.lua", type="Library", - version=1.01, + version=1.02, }, { name="lib/xmlParser.lua", diff --git a/Applications/.DS_Store b/Applications/.DS_Store index ba31b420..8c8ccecc 100644 Binary files a/Applications/.DS_Store and b/Applications/.DS_Store differ diff --git a/lib/compressor.lua b/lib/compressor.lua index 8c5450ad..04a06b5c 100644 --- a/lib/compressor.lua +++ b/lib/compressor.lua @@ -21,6 +21,7 @@ local function byteArrayToNumber(byteArray) end return number end + ------------------------------------------------------------------------------------------------------------------ local function writePath(compressedFile, path) @@ -66,8 +67,8 @@ end local function doCompressionRecursively(fileList, compressedFile, currentPackPath) for file = 1, #fileList do - local filename = fs.name(fileList[file]) - local filePackPath = currentPackPath .. fs.name(fileList[file]) + local filename = (fs.name(fileList[file]) or "") + local filePackPath = currentPackPath .. filename if filename ~= "mnt" and filename ~= ".DS_Store" then -- print("Локальный путь архива: " .. filePackPath) @@ -182,6 +183,10 @@ function compressor.unpack(pathToCompressedFile, pathWhereToUnpack) compressedFile:close() end +function compressor.packAll(pathToCompressedFile) + compressor.pack(pathToCompressedFile, getFileList("/")) +end + ------------------------------------------------------------------------------------------------------------------ -- compressor.pack("/test1.pkg", "/MineOS/System/OS/", "/etc/")