From bb9b15649deb4cedd8e3bee9dcd3621fab0fee33 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Wed, 5 Aug 2015 05:15:56 +0300 Subject: [PATCH] Update reload.lua --- Applications/reload.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Applications/reload.lua b/Applications/reload.lua index 623e9b74..c7b80c2b 100644 --- a/Applications/reload.lua +++ b/Applications/reload.lua @@ -7,21 +7,24 @@ local args = {...} --------------------------------------------------------------------------------------- local function printUsage() + print(" ") print("Использование:") print("reload <путь к файлу> - перезагружает файл с GitHub автора") + print(" ") end local function readFile() local readedFile = "" local file = io.open("System/OS/Applications.txt", "r") readedFile = file:read("*a") - readedFile = seri.unserialise(readedFile) + readedFile = seri.unserialize(readedFile) return readedFile end local function getGitHubUrl(name) local massiv = readFile() for i = 1, #massiv do + --print(massiv[i]["name"]) if massiv[i]["name"] == name then return massiv[i]["url"] end @@ -37,15 +40,8 @@ end --------------------------------------------------------------------------------------- -if args < 1 then printUsage(); return end -local url = getGitHubUrl(name) +if #args < 1 then printUsage(); return end +local url = getGitHubUrl(args[1]) if not url then error("На GitHub автора отсутствует указанный файл.") end reloadFromGitHub(url, args[1]) - - - - - - -