Environment
Default environment variables
lets
has builtin environ variables which user can override before lets execution. E.g LETS_DEBUG=1 lets test
LETS_DEBUG
- enable debug messagesLETS_CONFIG
- changes defaultlets.yaml
file path (e.g. LETS_CONFIG=lets.my.yaml)LETS_CONFIG_DIR
- changes path to dir wherelets.yaml
file placedNO_COLOR
- disables colored output. See https://no-color.org/
Environment variables available at command runtime
LETS_COMMAND_NAME
- string name of launched commandLETS_COMMAND_ARGS
- positional arguments for launched command, e.g. forlets run --debug --config=test.ini
it will contain--debug --config=test.ini
LETS_COMMAND_WORK_DIR
- absolute path towork_dir
specified in command.LETS_CONFIG
- absolute path to lets config file.LETS_CONFIG_DIR
- absolute path to lets config file firectory.LETS_SHELL
- shell from config or command.LETSOPT_<>
- options parsed from commandoptions
(docopt string). E.glets run --env=prod --reload
will beLETSOPT_ENV=prod
andLETSOPT_RELOAD=true
LETSCLI_<>
- options which values is a options usage. E.glets run --env=prod --reload
will beLETSCLI_ENV=--env=prod
andLETSCLI_RELOAD=--reload
Override command env with -E flag
You can override environment for command with -E
flag:
shell: bash
commands:
say:
env:
NAME: Rick
cmd: echo Hello ${NAME}
lets say
- prints Hello Rick
lets -E NAME=Morty say
- prints Hello Morty
Alternatively:
lets --env NAME=Morty say
- prints Hello Morty