Skip to content

Commit

Permalink
more debug logging in exec
Browse files Browse the repository at this point in the history
  • Loading branch information
mjurbanski-reef committed Mar 28, 2024
1 parent 5af9ef3 commit 07cb2a7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions b2/_internal/_cli/autocomplete_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def is_enabled(self) -> bool:
"pexpect is recommended for Zsh shell autocomplete installation check without tty. "
"You can install it via `pip install pexpect`."
)
_silent_success_run(
[self.shell_exec, '-c', 'autoload -Uz compinit; compinit; echo AUDIT; compaudit']
)

cmd = [self.shell_exec, '-i', '-c', f'[[ -v _comps[{quote(self.prog)}] ]]']
return _silent_success_run(cmd) if emulate_tty else _silent_success_run_with_pty(cmd)
Expand Down Expand Up @@ -258,9 +261,8 @@ def _silent_success_run_with_pty(cmd: list[str], timeout: int = 5, env: dict | N
finally:
child.close()

logger.debug(
"Command %r exited with code %r, output: %r", cmd, child.exitstatus, output.getvalue()
)
(logger.debug if child.exitstatus == 0 else logger.warning
)("Command %r exited with code %r, output: %r", cmd, child.exitstatus, output.getvalue())
return child.exitstatus == 0


Expand Down

0 comments on commit 07cb2a7

Please sign in to comment.