diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -16,6 +16,7 @@ - [Using Variables](#using-variables) - [String Formatting](#string-formatting) - [Always Use Variables](#always-use-variables) + - [Recursive Variables](#recursive-variables) - [Using Taskipy Without Poetry](#using-taskipy-without-poetry) - [Installing With PIP](#installing-with-pip) - [Running Tasks](#running-tasks-1) @@ -258,6 +259,24 @@ lint = "pylint {path}" black = "black {path}" ``` +#### Recursive Variables + +If we want to use variables within other variables, we can utilize recursive variables. By default, variables are not recursive, but we can specify a variable to be recursive by setting the `recursive` key to `true`. + +```toml +[tool.taskipy.settings] +use_vars = true + +[tool.taskipy.variables] +src_dir = "src" +package_dir = { var = "{src_dir}/package", recursive = true } + +[tool.taskipy.tasks] +echo = "echo {package_dir}" +``` + +In this example, we could run `task echo` and we would then see `src/package`. + ### Using Taskipy Without Poetry Taskipy was created with poetry projects in mind, but actually only requires a valid `pyproject.toml` file in your project's directory. As a result, you can use it even eithout poetry: |