feat: add upgrade program

This commit is contained in:
Guillaume ARM 2026-05-31 11:21:55 +02:00
parent 15e4373d0e
commit 75d638b42f
2 changed files with 32 additions and 1 deletions

View File

@ -1,4 +1,4 @@
local _VERSION = '2.0.2'
local _VERSION = '2.0.3'
local LIST_FILES = {
-- startup
@ -12,6 +12,7 @@ local LIST_FILES = {
'programs/ping.lua',
'programs/cube.lua',
'programs/goo.lua',
'programs/upgrade.lua',
-- apis
'apis/net.lua',
'apis/eventloop.lua',

30
programs/upgrade.lua Normal file
View File

@ -0,0 +1,30 @@
local _VERSION = '1.0.0';
local INSTALL_URL = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua';
local command = ...;
local function printUsage()
print('upgrade usage:');
print();
print('\t\t\tupgrade');
print('\t\t\tupgrade version');
print('\t\t\tupgrade help');
end
if command == 'version' or command == '-version' or command == '--version' then
print('upgrade v' .. _VERSION);
return;
end
if command == 'help' or command == '-help' or command == '--help' then
printUsage();
return;
end
if command ~= nil and command ~= '' then
printUsage();
return;
end
shell.execute('wget', 'run', INSTALL_URL);