mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-22 15:30:59 +02:00
AUTOENV_DEBUG=3 sets xtrace while sourcing; doc (#65)
This commit is contained in:
parent
3a19a22140
commit
738e6e965d
@ -126,6 +126,13 @@ Default: 0
|
|||||||
### AUTOENV\_DEBUG
|
### AUTOENV\_DEBUG
|
||||||
Enable debugging. Multiple levels are supported (max 2).
|
Enable debugging. Multiple levels are supported (max 2).
|
||||||
|
|
||||||
|
- 0: no debug messages
|
||||||
|
- 1: generic debug logging
|
||||||
|
- 2: more verbose messages
|
||||||
|
- messages about adding/removing files on the internal stack
|
||||||
|
- 3: everything
|
||||||
|
- sets xtrace option (`set -x`) while sourcing env files
|
||||||
|
|
||||||
Default: `0`
|
Default: `0`
|
||||||
|
|
||||||
## Recipes
|
## Recipes
|
||||||
|
@ -303,7 +303,16 @@ _autoenv_source() {
|
|||||||
# Source the env file.
|
# Source the env file.
|
||||||
_autoenv_debug "== SOURCE: ${bold_color:-}$autoenv_env_file${reset_color:-}\n PWD: $PWD"
|
_autoenv_debug "== SOURCE: ${bold_color:-}$autoenv_env_file${reset_color:-}\n PWD: $PWD"
|
||||||
: $(( _autoenv_debug_indent++ ))
|
: $(( _autoenv_debug_indent++ ))
|
||||||
|
|
||||||
|
local restore_xtrace
|
||||||
|
if [[ $AUTOENV_DEBUG -gt 2 && ! -o xtrace ]]; then
|
||||||
|
restore_xtrace=1
|
||||||
|
setopt localoptions xtrace
|
||||||
|
fi
|
||||||
source $autoenv_env_file
|
source $autoenv_env_file
|
||||||
|
if (( restore_xtrace )); then
|
||||||
|
setopt noxtrace
|
||||||
|
fi
|
||||||
: $(( _autoenv_debug_indent-- ))
|
: $(( _autoenv_debug_indent-- ))
|
||||||
_autoenv_debug "== END SOURCE =="
|
_autoenv_debug "== END SOURCE =="
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user