Multiple EnvAlias Files¶
Load many definitions in a single invocation and get one lazy alias per file. This is the recommended form when you have several projects, since it collapses many env-alias process startups into one.
Example¶
Save this ordinary definition as ~/.config/env-alias/env-project-a.yml:
env-alias:
SERVICE_A_URL:
source: "~/.config/project-a/service.json"
parser: "json"
selector: ".url"
Walkthrough:
-
Create the other project definition files in the same way, then register all of them at shell startup with one command:
source <(env-alias \ ~/.config/env-alias/env-project-a.yml \ ~/.config/env-alias/env-project-b.yml \ ~/.config/env-alias/env-project-c.yml)Or using a file pattern (glob):
-
One invocation emits one lazy alias per file, named from each basename —
env-project-a,env-project-b,env-project-c. - Each alias loads only its own file when invoked, so running
env-project-areads justSERVICE_A_URL, and nothing is fetched for a project until you actually use it.