aboutsummaryrefslogtreecommitdiff
path: root/tmuxrdr/scripts/test-e2e
diff options
context:
space:
mode:
Diffstat (limited to 'tmuxrdr/scripts/test-e2e')
-rwxr-xr-xtmuxrdr/scripts/test-e2e8
1 files changed, 6 insertions, 2 deletions
diff --git a/tmuxrdr/scripts/test-e2e b/tmuxrdr/scripts/test-e2e
index 0adaebc4..aa12d1ba 100755
--- a/tmuxrdr/scripts/test-e2e
+++ b/tmuxrdr/scripts/test-e2e
@@ -27,7 +27,11 @@ herdr="${HERDR:-tmuxrdr}"
delay="${TMUXRDR_E2E_DELAY:-0.8}"
session="tmuxrdr-e2e-$$"
T=(tmux -L "tmuxrdr-e2e-$$" -f /dev/null)
-H=("$herdr" --session "$session")
+# The script may run from inside a herdr pane, whose env names that pane; the
+# CLI would then look for it on the throwaway server and miss.
+u=(env -u HERDR_PANE_ID -u HERDR_TAB_ID -u HERDR_WORKSPACE_ID \
+ -u HERDR_SOCKET_PATH -u HERDR_CLIENT_SOCKET_PATH -u HERDR_ENV)
+H=("${u[@]}" "$herdr" --session "$session")
plugin_id="tmuxrdr.tmux-mode"
work="$(mktemp -d)"
cfg="$work/config.toml"
@@ -55,7 +59,7 @@ done
app="$(basename "$(dirname "$("$herdr" --help | sed -n 's/^Config: *//p')")")"
[[ "$app" == tmuxrdr ]] || die "$herdr keeps its files under '$app', not tmuxrdr: not a tmuxrdr build"
state="${XDG_STATE_HOME:-$HOME/.local/state}/$app/plugins/$plugin_id/$session"
-"$herdr" plugin list --json 2>/dev/null \
+"${H[@]}" plugin list --json 2>/dev/null \
| jq -e --arg id "$plugin_id" --arg root "$repo/tmuxrdr/plugin" \
'[.. | objects | select(.plugin_id? == $id and .plugin_root? == $root)] | length > 0' >/dev/null \
|| die "$plugin_id is not registered from this checkout; run tmuxrdr/scripts/install yes"