mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-09-14 00:46:56 +00:00
Helper functions refactoring
This commit is contained in:
@ -1,34 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
HELPERS_DIR="$CURRENT_DIR/helpers"
|
||||
|
||||
source "$CURRENT_DIR/shared_functions.sh"
|
||||
|
||||
TMUX_ECHO_FLAG="$1"
|
||||
|
||||
# True if invoked as tmux mapping or tmux command,
|
||||
# false if invoked via command line wrapper from `bin/` directory.
|
||||
use_tmux_echo() {
|
||||
[ "$TMUX_ECHO_FLAG" == "--tmux-echo" ]
|
||||
}
|
||||
|
||||
if use_tmux_echo; then
|
||||
# use tmux specific echo-ing
|
||||
echo_ok() {
|
||||
tmux_echo "$*"
|
||||
}
|
||||
|
||||
echo_err() {
|
||||
tmux_echo "$*"
|
||||
}
|
||||
else
|
||||
echo_ok() {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
echo_err() {
|
||||
fail_helper "$*"
|
||||
}
|
||||
if [ "$1" == "--tmux-echo" ]; then # tmux-specific echo functions
|
||||
source "$HELPERS_DIR/tmux_echo_functions.sh"
|
||||
else # shell output functions
|
||||
source "$HELPERS_DIR/shell_echo_functions.sh"
|
||||
fi
|
||||
|
||||
clone() {
|
||||
|
Reference in New Issue
Block a user