diff --git a/bash_it.sh b/bash_it.sh index 310aae42..a7960c75 100755 --- a/bash_it.sh +++ b/bash_it.sh @@ -74,6 +74,9 @@ if [[ ! -z "${BASH_IT_THEME}" ]]; then BASH_IT_LOG_PREFIX="themes: p4helpers: " # shellcheck source=./themes/p4helpers.theme.bash source "${BASH_IT}/themes/p4helpers.theme.bash" + BASH_IT_LOG_PREFIX="themes: command_duration: " + # shellcheck source=./themes/command_duration.theme.bash + source "${BASH_IT}/themes/command_duration.theme.bash" BASH_IT_LOG_PREFIX="themes: base: " # shellcheck source=./themes/base.theme.bash source "${BASH_IT}/themes/base.theme.bash" diff --git a/plugins/available/cmd-duration.plugin.bash b/themes/command_duration.theme.bash similarity index 94% rename from plugins/available/cmd-duration.plugin.bash rename to themes/command_duration.theme.bash index e21cbcaa..1bf969a5 100644 --- a/plugins/available/cmd-duration.plugin.bash +++ b/themes/command_duration.theme.bash @@ -1,5 +1,8 @@ -cite about-plugin -about-plugin 'keep track of the moment when the last command started, to be able to compute its duration' +#!/usr/bin/env bash + +if [ -z "$BASHIT_COMMAND_DURATION" ] || [ "$BASHIT_COMMAND_DURATION" != true ]; then + return +fi # Define tmp dir and file COMMAND_DURATION_TMPDIR="${TMPDIR:-/tmp}"