tfenv icon indicating copy to clipboard operation
tfenv copied to clipboard

Load Bashlog Conditionally

Open Zordrak opened this issue 4 years ago • 3 comments

Bashlog is slow and intensive and not always wanted.

When in an interactive shell, load it by default. When in a non-interactive shell, do not load it by default.

Add a shell variable to explicitly load or unload it.

When not loaded, the following log function or equivalent will need to be declared instead:

log () {
  [ "${1}" == "debug" ] || echo -e "${@:2}";
}
export -f log;

@anthraxx FYI this is next up on my list for a v3 release (being potentially backwards-breaking) - when I get a chance. I welcome someone else doing the legwork. It's a simple enough change, but warrants some testing and assurance, esp where testing for invocation from an interactive parent shell.

Zordrak avatar Jan 30 '21 17:01 Zordrak

Feature needed to resolve #196

Zordrak avatar Feb 06 '21 18:02 Zordrak

Im getting bitten badly by this issue too - any chance you could merge in the BASHLOG_DISABLE thing?

RoryKiefer avatar Dec 01 '21 20:12 RoryKiefer

FYI this is fixed now in https://github.com/tfutils/tfenv/releases/tag/v3.0.0

reegnz avatar Jul 18 '22 12:07 reegnz