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]) - - - - - - -