feat: add README + install.lua
This commit is contained in:
parent
9c0f7a79dc
commit
9b54225344
16
README.md
Normal file
16
README.md
Normal 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
27
install.lua
Normal 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)
|
||||
Loading…
Reference in New Issue
Block a user