mottosso / be

minimal directory and environment management system for collaborative creative projects
GNU Lesser General Public License v2.1
47 stars 4 forks source link

cascading configuration #29

Open mottosso opened 9 years ago

mottosso commented 9 years ago

goal

To enable per-item configuration, such as additional environment variables and aliases.

$ be in hulk bruce rigging --enter
$ maya
Launching Maya 2015..
$ be in hulk bruce rigging --enter
$ maya
Customised, launching Maya 2016..

implementation

The be.yaml configuration file is looked up at each level of the development directory.

E.g.

▸ hulk
  ▸ be.yaml
  ▾ assets
    ▾ bruce
      ▾ be.yaml

Each key is appended to the upper, children overwrite parents.

hulk/be.yaml

alias:
- maya: start "" "maya2015.exe"

bruce/be.yaml

alias:
- maya: start "" "maya2016.exe"
ghost commented 9 years ago

Sometimes environment variable need to be declared only for specific software. Like MAYA_SCRIPT_PATH or MAYA_PLUG_IN_PATH. I don't see how this would be done with only an alias system.

I think it would fit well to declare software in the be.yaml :

software:
  Maya:
    command: start "" "maya2016.exe"
     env:
        MAYA_PLUG_IN_PATH: path/to/plugins
        MAYA_SCRIPT_PATH: path/to/scripts

What do you think of this design ?

mottosso commented 9 years ago

Hi @hommes-doutant, you're absolutely right, this is an important aspect of configuring the environment. The intent is for this to be handled separately - in the simplest case, via so called "wrappers".