Fixed some other thing
This commit is contained in:
52
updater.lua
52
updater.lua
@@ -10,33 +10,7 @@ local keyboard=require("keyboard")
|
|||||||
local repository = "seesberger/PowerManager"
|
local repository = "seesberger/PowerManager"
|
||||||
local targetFilepath = "/usr/PowerManager/"
|
local targetFilepath = "/usr/PowerManager/"
|
||||||
|
|
||||||
local helpText = "Usage:\n" ..
|
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"
|
||||||
"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
|
|
||||||
|
|
||||||
function manualUpdate()
|
function manualUpdate()
|
||||||
downloadRepo(repository, targetFilepath, false)
|
downloadRepo(repository, targetFilepath, false)
|
||||||
@@ -168,7 +142,7 @@ function downloadRepo(repo, target, auto)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local replaceMode="ask"
|
local replaceMode="ask"
|
||||||
if auto then replacemode == "always" end
|
if auto then replacemode = "always" end
|
||||||
for i=1,#files do
|
for i=1,#files do
|
||||||
local replace=nil
|
local replace=nil
|
||||||
if filesystem.exists(target..files[i]) then
|
if filesystem.exists(target..files[i]) then
|
||||||
@@ -233,3 +207,25 @@ function downloadRepo(repo, target, auto)
|
|||||||
end
|
end
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user