Skip to content

Commit

Permalink
Swap to new pg:: namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dimo414 committed Jun 28, 2018
1 parent 5879ced commit 7de9708
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
10 changes: 5 additions & 5 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/unit-tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7de9708

Please sign in to comment.