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

{any} #7

Closed mottosso closed 9 years ago

mottosso commented 9 years ago

Goal

To add flexibility to available tokens.

At the moment, each token is hard-coded to only a certain few. Instead, have each token reference one of be's environment variables; i.e. any prefixed BE_.

For example, be defines a number of variables.

BE_PROJECT: Name of current project
BE_ITEM: Name of current item
BE_TASK: Task of current item
BE_DEVELOPMENTDIR: Absolute path to current development directory
BE_PROJECTROOT: Absolute path to current project
BE_PROJECTSROOT: Absolute path to where projects are located
BE_ACTIVE: In an active environment
BE_USER: Active[1] user
BE_SCRIPT: Path to script executed when entering a project
BE_PYTHON: Python command executed when entering a project
BE_ENTER: Whether or not the development directory was entered
BE_TEMPDIR: Path to current `be` temporary directory.
BE_ALIASDIR: Path to where `be` stores its aliases.

A token could then be a direct reference to any of these, excluding it's prefix.

BE_ITEM is referenced by {item}, and BE_PYTHON is referenced by {python}

asset: {cwd}/{user}/{item}

Providing complete backwards compatibility, and room for expansion. For example, a user could append an additional variable and use that in templates.

$ export BE_MYVAR=helloworld
asset: {cwd}/{myvar}