mirror of
https://github.com/Morantron/tmux-fingers.git
synced 2024-06-26 07:29:11 +02:00
fix brew installation method and show load-config errors
This commit is contained in:
parent
bcedda246b
commit
d588fd289f
|
@ -46,6 +46,16 @@ function install_from_source() {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_with_brew() {
|
||||||
|
echo "Installing with brew..."
|
||||||
|
brew tap morantron/tmux-fingers
|
||||||
|
brew install tmux-fingers
|
||||||
|
|
||||||
|
echo "Installation complete!"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function download_binary() {
|
function download_binary() {
|
||||||
mkdir -p $CURRENT_DIR/bin
|
mkdir -p $CURRENT_DIR/bin
|
||||||
# TODO check architecture
|
# TODO check architecture
|
||||||
|
@ -71,6 +81,7 @@ fi
|
||||||
|
|
||||||
if [[ "$1" == "install-with-brew" ]]; then
|
if [[ "$1" == "install-with-brew" ]]; then
|
||||||
echo "Installing with brew..."
|
echo "Installing with brew..."
|
||||||
|
install_with_brew
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -95,7 +106,6 @@ function binary_or_brew_action() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_message() {
|
function get_message() {
|
||||||
# if FINGERS_UPDATE is 1
|
|
||||||
if [[ "$FINGERS_UPDATE" == "1" ]]; then
|
if [[ "$FINGERS_UPDATE" == "1" ]]; then
|
||||||
echo "It looks like tmux-fingers has been updated. We need to rebuild the binary."
|
echo "It looks like tmux-fingers has been updated. We need to rebuild the binary."
|
||||||
else
|
else
|
||||||
|
|
|
@ -2,13 +2,23 @@
|
||||||
|
|
||||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
if [ ! -f "$CURRENT_DIR/bin/tmux-fingers" ]; then
|
if command -v "tmux-fingers" &>/dev/null; then
|
||||||
|
FINGERS_BINARY="tmux-fingers"
|
||||||
|
elif [[ -f "$CURRENT_DIR/bin/tmux-fingers" ]]; then
|
||||||
|
FINGERS_BINARY="$CURRENT_DIR/bin/tmux-fingers"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$FINGERS_BINARY" ]]; then
|
||||||
|
tmux display-message "running wisar because binary not found"
|
||||||
tmux run-shell -b "bash $CURRENT_DIR/install-wizard.sh"
|
tmux run-shell -b "bash $CURRENT_DIR/install-wizard.sh"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CURRENT_FINGERS_VERSION="$($CURRENT_DIR/bin/tmux-fingers version)"
|
CURRENT_FINGERS_VERSION="$($FINGERS_BINARY version)"
|
||||||
|
|
||||||
|
pushd $CURRENT_DIR &> /dev/null
|
||||||
CURRENT_GIT_VERSION=$(git describe --tags | sed "s/-.*//g")
|
CURRENT_GIT_VERSION=$(git describe --tags | sed "s/-.*//g")
|
||||||
|
popd &> /dev/null
|
||||||
|
|
||||||
SKIP_WIZARD=$(tmux show-option -gqv @fingers-skip-wizard)
|
SKIP_WIZARD=$(tmux show-option -gqv @fingers-skip-wizard)
|
||||||
SKIP_WIZARD=${SKIP_WIZARD:-0}
|
SKIP_WIZARD=${SKIP_WIZARD:-0}
|
||||||
|
@ -22,5 +32,5 @@ if [ "$SKIP_WIZARD" = "0" ] && [ "$CURRENT_FINGERS_VERSION" != "$CURRENT_GIT_VER
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"$CURRENT_DIR/bin/tmux-fingers" "load-config"
|
tmux run "$FINGERS_BINARY load-config"
|
||||||
exit $?
|
exit $?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user