-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathtmux-agent-sidebar.tmux
More file actions
executable file
·28 lines (21 loc) · 963 Bytes
/
Copy pathtmux-agent-sidebar.tmux
File metadata and controls
executable file
·28 lines (21 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -x "$PLUGIN_DIR/bin/tmux-agent-sidebar" ]]; then
SIDEBAR_BINARY="$PLUGIN_DIR/bin/tmux-agent-sidebar"
elif [[ -x "$PLUGIN_DIR/target/release/tmux-agent-sidebar" ]]; then
SIDEBAR_BINARY="$PLUGIN_DIR/target/release/tmux-agent-sidebar"
elif command -v "tmux-agent-sidebar" &>/dev/null; then
SIDEBAR_BINARY="tmux-agent-sidebar"
fi
if [[ -z "$SIDEBAR_BINARY" ]]; then
tmux run-shell -b "bash '$PLUGIN_DIR/install-wizard.sh'"
exit 0
fi
INSTALLED_VERSION="$("$SIDEBAR_BINARY" version 2>/dev/null)"
EXPECTED_VERSION="$(sed -n 's/^version *= *"\(.*\)"/\1/p' "$PLUGIN_DIR/Cargo.toml")"
if [[ -n "$EXPECTED_VERSION" && "$INSTALLED_VERSION" != "$EXPECTED_VERSION" ]]; then
tmux run-shell -b "SIDEBAR_UPDATE=1 bash '$PLUGIN_DIR/install-wizard.sh'"
exit 0
fi
tmux set -g @agent_sidebar_bin "$SIDEBAR_BINARY"
tmux source-file "$PLUGIN_DIR/agent-sidebar.conf"