diff --git a/commands.sh b/commands.sh index fe9f85a..f6f47e1 100644 --- a/commands.sh +++ b/commands.sh @@ -16,7 +16,7 @@ # It's also necessary to preserve this behavior during pgem_reload, which is the cause of most of # the complexity of this conditional. if $COMPATIBLE_WITH_PREEXEC && [[ -n "$__bp_imported" ]]; then - pgem_log "bash-preexec found; not updating PROMPT_COMMAND and DEBUG trap" + pg::log "bash-preexec found; not updating PROMPT_COMMAND and DEBUG trap" if [[ "$(type __bp_original_debug_trap 2>/dev/null)" != *" _time_command"* ]]; then for i in "${!preexec_functions[@]}"; do [[ "${preexec_functions[$i]}" == "_time_command" ]] && unset preexec_functions[$i] diff --git a/functions.sh b/functions.sh index 20e3c41..134f006 100644 --- a/functions.sh +++ b/functions.sh @@ -96,7 +96,7 @@ tagsh() { ssh() { # intentionally using which to not match this function # however this suppresses any ssh alias the user's defined - # perhaps we can use pgem_decorate instead? + # perhaps we can use pg::decorate instead? $(which ssh) "$@" local ret=$? tagsh "$_SHELL_TAG" @@ -114,14 +114,14 @@ short_pwd() { # Scheduled for removal in Aug 2018 _cache() { $ENABLE_CACHED_COMMANDS || return 0 - pgem_log "_cache is deprecated, please use bc::cache instead" + pg::log "_cache is deprecated, please use bc::cache instead" bc::cache "$@" } # Given a directory name (like .hg or .git) look through the pwd for such a repo _find_repo() { local dir repoMarker - dir=$(pwd) + dir=$PWD repoMarker=${1:?Must specify the marker that indicates a repo} while [[ "$dir" != "/" ]] do @@ -184,12 +184,12 @@ _prompt_command() { do # Trigger callbacks asynchronously and in the background; these callbacks # should block the next prompt from being rendered. - ("$callback" "$last_command" "$exit_code" "$runtime" "$(_format_seconds $runtime)" &) + ("$callback" "$last_command" "$exit_code" "$runtime" "$formatted_runtime" &) done if ((runtime >= DISPLAY_COMMAND_TIME_THRESHOLD)) then - formatted_runtime="$(pcolor yellow)$formatted_runtime$(pcolor) " + formatted_runtime="$(pcolor YELLOW)$formatted_runtime$(pcolor) " else formatted_runtime='' fi diff --git a/test/unit-tests.bats b/test/unit-tests.bats index 02c4949..9227274 100644 --- a/test/unit-tests.bats +++ b/test/unit-tests.bats @@ -2,8 +2,8 @@ # # Unit tests for prompt.gem -pgem_log() { echo "PGEM_LOG" "$@"; } -pgem_decorate() { :; } +pg::log() { echo "PGEM_LOG" "$@"; } +pg::decorate() { :; } bc::cache() { :; } source "$BATS_TEST_DIRNAME/../functions.sh"