add pack.assemble(...), app.config_packs(...)
This commit is contained in:
@@ -48,7 +48,8 @@ app.reconfig_packs(
|
||||
)
|
||||
```
|
||||
|
||||
Updates the pack configuration, checking its correctness (dependencies and availability of packs).
|
||||
Updates the packs configuration, checking its correctness (dependencies and availability of packs).
|
||||
Automatically adds dependencies.
|
||||
|
||||
To remove all packs from the configuration, you can use `pack.get_installed()`:
|
||||
|
||||
@@ -58,6 +59,16 @@ app.reconfig_packs({}, pack.get_installed())
|
||||
|
||||
In this case, `base` will also be removed from the configuration.
|
||||
|
||||
```lua
|
||||
app.config_packs(
|
||||
-- expected set of packs (excluding dependencies)
|
||||
packs: table
|
||||
)
|
||||
```
|
||||
|
||||
Updates the packs configuration, automatically removing unspecified ones, adding those missing in the previous configuration.
|
||||
Uses app.reconfig_packs.
|
||||
|
||||
```lua
|
||||
app.new_world(
|
||||
-- world name
|
||||
|
||||
@@ -96,8 +96,14 @@ Returns information about the pack (not necessarily installed).
|
||||
- `~` - weak
|
||||
for example `!teal`
|
||||
|
||||
To obtain information about multiple packs, use table of ids to avoid re-scanning.
|
||||
To obtain information about multiple packs, use table of ids to avoid re-scanning:one
|
||||
|
||||
```lua
|
||||
pack.get_info(packids: table) -> {id={...}, id2={...}, ...}
|
||||
```
|
||||
|
||||
```lua
|
||||
pack.assemble(packis: table) -> table
|
||||
```
|
||||
|
||||
Checks the configuration for correctness and adds dependencies, returning the complete configuration.
|
||||
|
||||
@@ -49,6 +49,7 @@ app.reconfig_packs(
|
||||
```
|
||||
|
||||
Обновляет конфигурацию паков, проверяя её корректность (зависимости и доступность паков).
|
||||
Автоматически добавляет зависимости.
|
||||
|
||||
Для удаления всех паков из конфигурации можно использовать `pack.get_installed()`:
|
||||
|
||||
@@ -58,6 +59,16 @@ app.reconfig_packs({}, pack.get_installed())
|
||||
|
||||
В этом случае из конфигурации будет удалён и `base`.
|
||||
|
||||
```lua
|
||||
app.config_packs(
|
||||
-- ожидаемый набор паков (без учёта зависимостей)
|
||||
packs: table
|
||||
)
|
||||
```
|
||||
|
||||
Обновляет конфигурацию паков, автоматически удаляя лишние, добавляя отсутствующие в прошлой конфигурации.
|
||||
Использует app.reconfig_packs.
|
||||
|
||||
```lua
|
||||
app.new_world(
|
||||
-- название мира
|
||||
|
||||
@@ -84,8 +84,14 @@ pack.get_info(packid: str) -> {
|
||||
например `!teal`
|
||||
|
||||
Для получения информации о нескольких паках используйте таблицу id, чтобы не
|
||||
производить сканирование для каждого пака.
|
||||
производить сканирование для каждого пака:
|
||||
|
||||
```lua
|
||||
pack.get_info(packids: table) -> {id={...}, id2={...}, ...}
|
||||
```
|
||||
|
||||
```lua
|
||||
pack.assemble(packis: table) -> table
|
||||
```
|
||||
|
||||
Проверяет корректность конфигурации и добавляет зависимости, возвращая полную.
|
||||
|
||||
Reference in New Issue
Block a user