From a9a78ba43e52a87d23314a2931c65df4a4c9410f Mon Sep 17 00:00:00 2001 From: shmyga Date: Tue, 28 Mar 2023 22:26:42 +0300 Subject: [PATCH] docs: update readme --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/README.md b/README.md index eee69df..ec979f7 100644 --- a/README.md +++ b/README.md @@ -1 +1,58 @@ # Project Manager + +## Install + +```bash +pip install project-manager -i https://instreamatic.com/nexus/repository/pypi/simple/ +``` + +## Usage + +### Show tasks list + +```bash +pm [-v] [-vv] +``` + +### Run task + +```bash +pm [-v] [-vv] +``` + +## Presets locations + +- default presets `$PROJECT_MANAGER/project_manager/preset/default/*.toml` +- user preset `$HOME/.preset.toml` +- project preset `./.preset.toml` + + +## Preset format + +### Template + +```toml +[presets..tasks..] +conditions = [""] +commands = [""] +``` + +### Copy default config sample + +```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)