Fixed some other thing

This commit is contained in:
2024-02-23 16:48:03 +01:00
parent f82608dad6
commit 31b9ca7e8c

View File

@@ -10,33 +10,7 @@ local keyboard=require("keyboard")
local repository = "seesberger/PowerManager"
local targetFilepath = "/usr/PowerManager/"
local helpText = "Usage:\n" ..
"updater <nothing> - manual update and install\n"..
"updater -h - this particular text\n" ..
" '' -a - automatic update no install\n" ..
" '' -i - automatic update and install"
if #args<1 then
print("No Arguments given. Manual process...")
manualUpdate()
return
end
if args == "-h" then
print(helpText)
return
elseif args == "-a" then
automaticUpdate()
return
elseif args == "-i" then
automaticUpdate()
automaticInstall()
return
else
print('"'..args[1]..'" - Bad argument.')
print(helpText)
return
end
local helpText = "Usage:\n" .. "updater <nothing> - manual update and install\n".."updater -h - this particular text\n" .. " '' -a - automatic update no install\n" .. " '' -i - automatic update and install"
function manualUpdate()
downloadRepo(repository, targetFilepath, false)
@@ -168,7 +142,7 @@ function downloadRepo(repo, target, auto)
end
local replaceMode="ask"
if auto then replacemode == "always" end
if auto then replacemode = "always" end
for i=1,#files do
local replace=nil
if filesystem.exists(target..files[i]) then
@@ -233,3 +207,25 @@ function downloadRepo(repo, target, auto)
end
end
if #args<1 then
print("No Arguments given. Manual process...")
manualUpdate()
return
end
if args == "-h" then
print(helpText)
return
elseif args == "-a" then
automaticUpdate()
return
elseif args == "-i" then
automaticUpdate()
automaticInstall()
return
else
print('"'..args[1]..'" - Bad argument.')
print(helpText)
return
end