about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/tmux-plugins/tmux-thumbs/fix.patch
blob: 326696ebc40a29fa55c5435c5eff812f576d12d0 (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
diff --git a/tmux-thumbs.sh b/tmux-thumbs.sh
index 34dd528..8c05d54 100755
--- a/tmux-thumbs.sh
+++ b/tmux-thumbs.sh
@@ -1,22 +1,8 @@
 #!/usr/bin/env bash
 set -Eeu -o pipefail
 
-VERSION=$(grep 'version =' Cargo.toml | grep -oe "[0-9]\+.[0-9]\+.[0-9]\+")
-
 # Setup env variables to be compatible with compiled and bundled installations
 CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-RELEASE_DIR="${CURRENT_DIR}/target/release"
-
-THUMBS_BINARY="${RELEASE_DIR}/thumbs"
-TMUX_THUMBS_BINARY="${RELEASE_DIR}/tmux-thumbs"
-
-if [ ! -f "$THUMBS_BINARY" ]; then
-  tmux split-window "cd ${CURRENT_DIR} && bash ./tmux-thumbs-install.sh"
-  exit
-elif [[ $(${THUMBS_BINARY} --version) != "thumbs ${VERSION}"  ]]; then
-  tmux split-window "cd ${CURRENT_DIR} && bash ./tmux-thumbs-install.sh update"
-  exit
-fi
 
 function get-opt-value() {
   tmux show -vg "@thumbs-${1}" 2> /dev/null
@@ -36,7 +22,7 @@ function get-opt-arg() {
   fi
 }
 
-PARAMS=(--dir "${CURRENT_DIR}")
+PARAMS=(--dir @tmuxThumbsDir@)
 
 function add-param() {
   local type opt arg
@@ -51,4 +37,4 @@ add-param upcase-command string
 add-param multi-command  string
 add-param osc52          boolean
 
-"${TMUX_THUMBS_BINARY}" "${PARAMS[@]}" || true
+@tmuxThumbsDir@/tmux-thumbs "${PARAMS[@]}" || true