feat: add beta install flag
This commit is contained in:
parent
a373d140e8
commit
705f64c68a
@ -46,7 +46,7 @@ These are duplicated as local constants across files; keep them in sync when cha
|
|||||||
|
|
||||||
## Installation / distribution
|
## 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
|
## Conventions
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,11 @@
|
|||||||
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua
|
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
|
||||||
- `/apis/eventloop`: a simple event loop API.
|
- `/apis/eventloop`: a simple event loop API.
|
||||||
- `/apis/net`: an API to simplify sending and receiving routed messages, based on the `eventloop` library.
|
- `/apis/net`: an API to simplify sending and receiving routed messages, based on the `eventloop` library.
|
||||||
@ -17,6 +22,7 @@ All servers are automatically started at boot.
|
|||||||
## Programs
|
## Programs
|
||||||
- `router`: routes messages. You need to set up a router to use all `apis/net`-based programs and libraries.
|
- `router`: routes messages. You need to set up a router to use all `apis/net`-based programs and libraries.
|
||||||
- `ping`: pings machines using `apis/net`.
|
- `ping`: pings machines using `apis/net`.
|
||||||
|
- `upgrade`: upgrades the machine. Use `upgrade --beta` to install from the beta branch.
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
See [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup and workflow.
|
See [DEVELOPMENT.md](./DEVELOPMENT.md) for development setup and workflow.
|
||||||
|
|||||||
22
install.lua
22
install.lua
@ -1,4 +1,6 @@
|
|||||||
local _VERSION = '2.0.4'
|
local _VERSION = '2.1.0'
|
||||||
|
|
||||||
|
local command = ...;
|
||||||
|
|
||||||
local LIST_FILES = {
|
local LIST_FILES = {
|
||||||
-- startup
|
-- startup
|
||||||
@ -14,6 +16,22 @@ local LIST_FILES = {
|
|||||||
'apis/eventloop.lua',
|
'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
|
-- remove old files
|
||||||
fs.delete('ping-server.lua'); -- replaced by `servers/ping-server.lua`
|
fs.delete('ping-server.lua'); -- replaced by `servers/ping-server.lua`
|
||||||
fs.delete('ping.lua') -- replaced by `programs/ping.lua`
|
fs.delete('ping.lua') -- replaced by `programs/ping.lua`
|
||||||
@ -25,7 +43,7 @@ fs.delete('programs/goo.lua');
|
|||||||
fs.delete('servers/cube-server.lua');
|
fs.delete('servers/cube-server.lua');
|
||||||
fs.delete('servers/cube-boot.lua');
|
fs.delete('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()
|
local previousDir = shell.dir()
|
||||||
|
|
||||||
|
|||||||
@ -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 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 = ...;
|
local command = ...;
|
||||||
|
|
||||||
@ -8,6 +9,7 @@ local function printUsage()
|
|||||||
print('upgrade usage:');
|
print('upgrade usage:');
|
||||||
print();
|
print();
|
||||||
print('\t\t\tupgrade');
|
print('\t\t\tupgrade');
|
||||||
|
print('\t\t\tupgrade --beta');
|
||||||
print('\t\t\tupgrade version');
|
print('\t\t\tupgrade version');
|
||||||
print('\t\t\tupgrade help');
|
print('\t\t\tupgrade help');
|
||||||
end
|
end
|
||||||
@ -22,6 +24,11 @@ if command == 'help' or command == '-help' or command == '--help' then
|
|||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if command == '--beta' or command == '-beta' then
|
||||||
|
shell.execute('wget', 'run', BETA_INSTALL_URL, '--beta');
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
|
||||||
if command ~= nil and command ~= '' then
|
if command ~= nil and command ~= '' then
|
||||||
printUsage();
|
printUsage();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user