feat: add task key sub_tag

This commit is contained in:
2026-08-28 15:44:46 +03:00
parent a77a430d51
commit 5401f04485
10 changed files with 136 additions and 80 deletions
+6 -23
View File
@@ -3,7 +3,7 @@
## Install
```bash
pip install project-manager -i https://instreamatic.com/nexus/repository/pypi/simple/
pipx install project-manager -i https://git.shmyga.ru/InfernalGames/project-manager/packages
```
## Usage
@@ -17,42 +17,25 @@ pm [-v] [-vv]
### Run task
```bash
pm <task> [-v] [-vv]
pm <task>[:<tag>] [-v] [-vv]
```
## Presets locations
- default presets `$PROJECT_MANAGER/project_manager/preset/default/*.toml`
- default presets [`project_manager/preset/default/*.toml`](./project_manager/preset/default)
- user preset `$HOME/.pm.toml`
- project preset `./.pm.toml`
## Preset format
### Template
```toml
[presets.<entry_type>.tasks.<task_name>.<tag>]
[presets.<tag>.tasks.<task>.<type>]
conditions = ["<condition>"]
commands = ["<command>"]
```
### Copy default config sample
### Examples
```toml
[presets.config.tasks.setup.config]
conditions = ["file(config/base.yaml)", "file(config/current.yaml) | not"]
commands = ["cp ../../config/admin/dev/localhost.yaml config/current.yaml"]
```
## Condition pipe format
`function_name1(arg1,arg2) | function_name2(arg1)`
### Condition functions
- **file**: `file(filename)` - check file/directory exists or load file content as dict for next pipe
- **get**: `get(keypath)` - get value from dict by key path with dot separator
- **not**: `not` - invert pipe value as bool
- **equal**: `equal(string)` - compare pipe value with string
- **search**: `search(regexp, [index=1])` - match pipe value with regexp and return matched group by index (default 1)
[Default presets](./project_manager/preset/default)