Many projects, one configuration#
The simplest way to use Enkaidu is to create a single config file called enkaidu.yml in your home directory outside all your project workspaces.
When you run enkaidu from either the Project1/ or the Project2/ folder, Enkaidu detects the config file in your home folder and loads that.
I suggest having one in your home folder even if you later decide you need a different config for one of your projects.
One project, one configuration#
The next easiest way to use Enkaidu is to create a config file called enkaidu.yml in your project’s workspace.
When you run enkaidu from the Project/ folder, this config file will be loaded.
If you happen to also have an enkaidu.yml file in your home folder, Enkaidu will choose this one. Nearest config has precedence. More on this down below.
One project, one profile#
An alternative way to use Enkaidu is to create a profile folder called .enkaidu/ in your project’s workspace.
When you run enkaidu from the Project/ folder, Enkaidu sees the .enkaidu/ folder and loads the config.yml file if one exists.
Enkaidu looks for a profile folder first before looking for configuration files in the current or home folders.
Multiple config files#
Since you could have one or more config files at the same time, Enkaidu has a clear strategy based on proximity to determine how config files are loaded.
We’ve established three possible locations for config files:
- One in the home folder, aka (H)
- One in the workspace, aka (W)
- One in the profile folder in a workspace, aka (P)
| (H) | (P) | (W) | Summary |
|---|---|---|---|
| 1️⃣ | - | - | The one in the home folder is loaded. Easy. |
| - | - | 1️⃣ | The one in the workspace folder is loaded. Easy. |
| - | 1️⃣ | - | The one in the profile folder is loaded. Easy. |
| ❌ | - | 1️⃣ | The nearest config file, in the workspace, is loaded. |
| - | 2️⃣ | 1️⃣ | Both are loaded and merged, with precedence given to the workspace config. |
| 2️⃣ | 1️⃣ | - | Both are loaded and merged, with precedence given to the profile config. |
| ❌ | 2️⃣ | 1️⃣ | The nearest one (W) and the profile config are both loaded, with precedence given to the workspace config. |
It looks more complicated than it is. The rules are as follows:
- the nearest
enkaidu.yml|yamlis loaded, the other is ignored. - the profile’s
config.yml|yamlis always loaded if present - if one of each is loaded, when merging them the nearest one has precedence.
Most of the time you may never need to think about this. Put an enkaidu.yaml in one place or the other and move on.
More to profiles than a config.yml#
However, Enkaidu’s profiles are more than just for a config file. More on that in another post.