diff --git a/shortcut.lua b/shortcut.lua
index fce292c..bd60ee1 100644
--- a/shortcut.lua
+++ b/shortcut.lua
@@ -1,7 +1,7 @@
local args = {...}
local helpText = "This is a tool for displaying and managing your Power cells and generators.\n"..
- "Usages:"..
- "powerman - no args: starts the application"..
+ "Usages:\n"..
+ "powerman - no args: starts the application\n"..
" '' -h - this help text\n" ..
" '' update "
diff --git a/updater.lua b/updater.lua
index c7851e3..9588cd2 100644
--- a/updater.lua
+++ b/updater.lua
@@ -8,9 +8,11 @@ local event=require("event")
local keyboard=require("keyboard")
local repository = "seesberger/PowerManager"
-local targetFilepath = "/usr/PowerManager/"
+local repoTargetPath = "/usr/PowerManager/"
+local libTargetPath = "/lib/"
-local helpText = "Usage:\n" ..
+local helpText = "This updater pulls the git files for installation and application updates.\n"..
+ "Usage:\n" ..
"updater - no args: manual update and install\n"..
" '' -h - this help text\n" ..
" '' -a - automatic update no install\n" ..
@@ -18,22 +20,30 @@ local helpText = "Usage:\n" ..
function manualUpdate()
print("Manual repo pull...")
- downloadRepo(repository, targetFilepath, false)
+ downloadRepo(repository, repoTargetPath, false)
end
function manualInstall()
print("installing shortcut...")
- os.execute("mv shortcut.lua /usr/bin/powerman.lua")
+ os.execute("mv "..repoTargetPath.."shortcut.lua /usr/bin/powerman.lua")
end
function automaticUpdate()
print("Auto repo pull...")
- downloadRepo(repository, targetFilepath, true)
+ downloadRepo(repository, repoTargetPath, true)
end
function automaticInstall()
- print("Installing shortcut...")
- os.execute("mv shortcut.lua /usr/bin/powerman.lua")
+ print("downloading GUI-API")
+ downloadDependencies()
+ manualInstall()
+end
+
+function downloadDependencies(automatic)
+ os.execute("wget -f https://github.com/kevinkk525/OC-GUI-API/raw/master/shapes_default.lua /lib/shapes_default.lua")
+ os.execute("wget -f https://github.com/kevinkk525/OC-GUI-API/raw/master/GUI.lua /lib/GUI.lua")
+ os.execute("wget -f https://github.com/kevinkk525/OC-GUI-API/raw/master/term_mod.lua /lib/term_mod.lua")
+ os.execute("wget -f https://github.com/kevinkk525/OC-GUI-API/raw/master/tech_demo.lua /home/GUI_tech_demo.lua")
end
function downloadRepo(repo, target, automatic)