feat: add README + install.lua

This commit is contained in:
Guillaume ARM 2022-07-15 14:04:48 +02:00
parent 9c0f7a79dc
commit 9b54225344
2 changed files with 43 additions and 0 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# CC apis
## Installation
```
wget run https://raw.githubusercontent.com/guillaumearm/cc-libs/master/install.lua
```
## Apis
- `apis/net`: api to simplify sending and receiving routed messages
## Servers
- `router`: route messages (you need to setup a router to use `apis/net`)
- `ping-server`: is automatically started on boot (use `apis/net`)
## Programs
- `ping` : ping machines (use `apis/net`)

27
install.lua Normal file
View File

@ -0,0 +1,27 @@
local LIST_FILES = {
'ping.lua',
'ping-server.lua',
'router.lua',
'startup/servers.lua',
'apis/net.lua',
};
local REPO_PREFIX = 'https://raw.githubusercontent.com/guillaumearm/cc-libs/master/'
local previousDir = shell.dir()
shell.setDir('/')
fs.makeDir('/apis');
fs.makeDir('/startup');
for _, filePath in pairs(LIST_FILES) do
fs.delete(filePath)
shell.execute('wget', REPO_PREFIX .. filePath, filePath)
end
print()
print('=> Execute startup.lua')
shell.execute('/startup.lua')
shell.setDir(previousDir)