From e97f719ee82c4b02cae2066fd4b828d7632b05de Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Mon, 23 Jan 2017 03:57:50 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D1=83=D0=B0=D1=84=D0=B0=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MineOS/MineOSPacker.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/MineOS/MineOSPacker.lua b/MineOS/MineOSPacker.lua index 9400413c..83f7fbc8 100644 --- a/MineOS/MineOSPacker.lua +++ b/MineOS/MineOSPacker.lua @@ -2,6 +2,7 @@ local args = {...} local fs = require("filesystem") local component = require("component") +local compressor ------------------------------------------------------------------------------------------------------------ @@ -50,6 +51,7 @@ end local function getCompressor() print("Downloading compressor library...") getFile(compressorURL, compressorPath) + compressor = dofile(compressorPath) print("Done.") print(" ") end @@ -63,17 +65,20 @@ end ------------------------------------------------------------------------------------------------------------ -getCompressor() -local compressor = dofile(compressorPath) - if args[1] == "pack" then + getCompressor() packageFileList[#packageFileList + 1] = true compressor.pack(args[2], table.unpack(packageFileList)) elseif args[1] == "unpack" and args[2] and fs.exists(args[2]) then + getCompressor() compressor.unpack(args[2], "/", true) + require("computer").shutdown(true) elseif args[1] == "unpackFromMineOSRepository" then + getCompressor() getPackage() compressor.unpack(MineOSPackagePath, "/", true) + fs.remove(MineOSPackagePath) + require("computer").shutdown(true) else print("Usage:") print(" MineOSPacker pack ")