install wizard WIP
This commit is contained in:
parent
d64b37c58b
commit
aed1ce476d
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
PLATFORM=$(uname -s)
|
||||
|
||||
if [[ "$1" == "download-binary" ]]; then
|
||||
echo "Downloading binary..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$1" == "install-with-brew" ]]; then
|
||||
echo "Installing with brew..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "$1" == "install-fromsource" ]]; then
|
||||
echo "Install from source..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
function binary_or_brew_label() {
|
||||
if [[ "$PLATFORM" == "Darwin" ]]; then
|
||||
echo "Install from source"
|
||||
else
|
||||
echo "Download binary"
|
||||
fi
|
||||
}
|
||||
|
||||
function binary_or_brew_action() {
|
||||
if [[ "$PLATFORM" == "Darwin" ]]; then
|
||||
echo "download-binary"
|
||||
else
|
||||
echo "install-with-brew"
|
||||
fi
|
||||
}
|
||||
|
||||
tmux display-menu -T "tmux-fingers" \
|
||||
"" \
|
||||
"- " "" ""\
|
||||
"- #[nodim,bold]Welcome to tmux-fingers! ✌️ " "" ""\
|
||||
"- " "" ""\
|
||||
"- It looks like it is the first time you are running the plugin. We need the binary first for things to work. " "" "" \
|
||||
"- " "" ""\
|
||||
"" \
|
||||
"$(binary_or_brew_label)" b "display-popup 'bash $CURRENT_DIR/$0 $(binary_or_brew_label)" \
|
||||
"Build from source" s "display-popup 'bash $CURRENT_DIR/$0 install-from-source'" \
|
||||
"" \
|
||||
"Exit" q ""
|
|
@ -1,8 +1,10 @@
|
|||
#!/usr/bin/env ruby
|
||||
#!/usr/bin/env bash
|
||||
|
||||
fingers_root = File.dirname(__FILE__)
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
redirect_to_log_file = ">>#{fingers_root}/fingers.log 2>&1"
|
||||
if [ ! -f "$CURRENT_DIR/bin/tmux-fingers" ]; then
|
||||
echo "tmux-fingers not found. Please run ./install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
`tmux run-shell -b "#{fingers_root}/bin/fingers load_config"`
|
||||
`tmux run-shell -b "#{fingers_root}/bin/fingers check_version #{redirect_to_log_file}"`
|
||||
"$CURRENT_DIR/bin/tmux-fingers" "load-config"
|
||||
|
|
Loading…
Reference in New Issue