From 9a519f3bbb1bb8c09b42c993db2a476253abbeac Mon Sep 17 00:00:00 2001 From: BarbUk Date: Sun, 22 Nov 2020 23:53:51 +0400 Subject: [PATCH] Define a defaut command to remove need for _command_exists in theme --- themes/barbuk/barbuk.theme.bash | 4 +--- themes/command_duration.theme.bash | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/barbuk/barbuk.theme.bash b/themes/barbuk/barbuk.theme.bash index 6536aee8..c2b020dc 100644 --- a/themes/barbuk/barbuk.theme.bash +++ b/themes/barbuk/barbuk.theme.bash @@ -74,9 +74,7 @@ function _exit-code { function _prompt { local exit_code="$?" wrap_char=' ' dir_color=$green ssh_info='' python_venv='' host command_duration= - if _command_exists _command_duration; then - command_duration=$(_command_duration) - fi + command_duration=$(_command_duration) _exit-code exit_code _git-uptream-remote-logo diff --git a/themes/command_duration.theme.bash b/themes/command_duration.theme.bash index 42c58904..0c83c13f 100644 --- a/themes/command_duration.theme.bash +++ b/themes/command_duration.theme.bash @@ -1,6 +1,9 @@ #!/usr/bin/env bash if [ -z "$BASH_IT_COMMAND_DURATION" ] || [ "$BASH_IT_COMMAND_DURATION" != true ]; then + _command_duration() { + echo -n + } return fi