feat: add beta install flag

This commit is contained in:
Guillaume ARM 2026-06-07 19:47:45 +02:00
parent 9dd4455203
commit 42796c13f7
4 changed files with 35 additions and 4 deletions

View File

@ -57,7 +57,7 @@ These are duplicated as local constants across files; keep them in sync when cha
## Installation / distribution
`install.lua` is fetched and run on a machine via `wget run <raw-github-url>/install.lua`. It deletes old paths, re-downloads every file in `LIST_FILES` from the `master` branch raw GitHub URL, and runs `startup/servers.lua`. **When adding a new file that ships to machines, add it to `LIST_FILES` in `install.lua`** (and to `SERVERS` in `startup/servers.lua` if it's a server).
`install.lua` is fetched and run on a machine via `wget run <raw-github-url>/install.lua`. It deletes old paths, re-downloads every file in `LIST_FILES` from the `master` branch raw GitHub URL by default, or from `next` when run with `--beta`, and runs `startup/servers.lua`. **When adding a new file that ships to machines, add it to `LIST_FILES` in `install.lua`** (and to `SERVERS` in `startup/servers.lua` if it's a server).
## Conventions

View File

@ -5,6 +5,11 @@
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua
```
Install the beta branch:
```
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/next/install.lua --beta
```
## APIs
- `/apis/eventloop`: a simple event loop API.
- `/apis/net`: an API to simplify sending and receiving routed messages, based on the `eventloop` library.
@ -21,6 +26,7 @@ All servers are automatically started at boot.
- `ping`: pings machines using `apis/net`.
- `cube`: cube client for deployment. Use the `cube help` command for more details.
- `goo`: turtle program for Just Dire Things goo block processing.
- `upgrade`: upgrades the machine. Use `upgrade --beta` to install from the beta branch.
## Development
See [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup and workflow.

View File

@ -1,4 +1,6 @@
local _VERSION = '2.0.3'
local _VERSION = '2.1.0'
local command = ...;
local LIST_FILES = {
-- startup
@ -18,6 +20,22 @@ local LIST_FILES = {
'apis/eventloop.lua',
};
local function printUsage()
print('install usage:');
print();
print('\t\t\twget run <install-url>');
print('\t\t\twget run <install-url> --beta');
end
local branch = 'master';
if command == '--beta' or command == '-beta' then
branch = 'next';
elseif command ~= nil and command ~= '' then
printUsage();
return;
end
-- remove old files
fs.delete('ping-server.lua'); -- replaced by `servers/ping-server.lua`
fs.delete('ping.lua') -- replaced by `programs/ping.lua`
@ -25,7 +43,7 @@ fs.delete('cube.lua') -- replaced by `programs/cube.lua`
fs.delete('router.lua') -- replaced by `programs/router.lua`
fs.delete('servers/cube-startup.lua'); -- replaced by `servers/cube-boot.lua`
local REPO_PREFIX = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/master/'
local REPO_PREFIX = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/' .. branch .. '/'
local previousDir = shell.dir()

View File

@ -1,6 +1,7 @@
local _VERSION = '1.0.0';
local _VERSION = '1.1.0';
local INSTALL_URL = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua';
local BETA_INSTALL_URL = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/next/install.lua';
local command = ...;
@ -8,6 +9,7 @@ local function printUsage()
print('upgrade usage:');
print();
print('\t\t\tupgrade');
print('\t\t\tupgrade --beta');
print('\t\t\tupgrade version');
print('\t\t\tupgrade help');
end
@ -22,6 +24,11 @@ if command == 'help' or command == '-help' or command == '--help' then
return;
end
if command == '--beta' or command == '-beta' then
shell.execute('wget', 'run', BETA_INSTALL_URL, '--beta');
return;
end
if command ~= nil and command ~= '' then
printUsage();
return;