add option to skip install wizard

This commit is contained in:
Jorge Morante 2023-09-18 17:16:22 +02:00
parent cb943c00cc
commit 9071a366d7
3 changed files with 10 additions and 6 deletions

View File

@ -55,7 +55,6 @@ function download_binary() {
# TODO use "latest" tag
url=$(curl -s "https://api.github.com/repos/morantron/tmux-fingers/releases" | grep browser_download_url | tail -1 | grep -o https://.*x86_64)
echo "Downloading binary from $url"
# download binary to bin/tmux-fingers

View File

@ -1,3 +1,4 @@
set -g @fingers-benchmark-mode '1'
set -g @fingers-skip-wizard '1'
set -g default-terminal 'screen-256color'
run '/app/tmux-fingers.tmux'

View File

@ -1,7 +1,5 @@
#!/usr/bin/env bash
echo "sourcing tmux-fingers.tmux" >> /tmp/wat.log
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ ! -f "$CURRENT_DIR/bin/tmux-fingers" ]; then
@ -12,11 +10,17 @@ fi
CURRENT_FINGERS_VERSION="$($CURRENT_DIR/bin/tmux-fingers version)"
CURRENT_GIT_VERSION=$(git describe --tags | sed "s/-.*//g")
if [ "$CURRENT_FINGERS_VERSION" != "$CURRENT_GIT_VERSION" ]; then
SKIP_WIZARD=$(tmux show-option -gqv @fingers-skip-wizard)
SKIP_WIZARD=${SKIP_WIZARD:-0}
if [ "$SKIP_WIZARD" = "0" ] && [ "$CURRENT_FINGERS_VERSION" != "$CURRENT_GIT_VERSION" ]; then
tmux run-shell -b "FINGERS_UPDATE=1 bash $CURRENT_DIR/install-wizard.sh"
exit 0
if [[ "$?" != "0" ]]; then
echo "Something went wrong while updating tmux-fingers. Please try again."
exit 1
fi
fi
echo "running bin/tmux-fingers load-config" >> /tmp/wat.log
"$CURRENT_DIR/bin/tmux-fingers" "load-config"
exit $?