tools(tmux): fix script argument
Correctly drops tmux panel into an adb shell.
Does not perform `basename` on non-file scripts
Change-Id: If0139091a7d532712c6a86cc2aaf860911fb492f
diff --git a/tools/tmux b/tools/tmux
index 4506bef..035127f 100755
--- a/tools/tmux
+++ b/tools/tmux
@@ -296,6 +296,9 @@
if [[ -n "$SCRIPT" ]]; then
tmux select-pane -t 3
tmux send-keys "clear" C-m
+ if is_android "$OUT"; then
+ tmux send-keys "adb shell" C-m
+ fi
fi
sleep 2
@@ -339,7 +342,11 @@
tmux send-keys "PS1='[script]$ '" Enter
tmux send-keys "cd $DIR" Enter
tmux send-keys "clear" C-m
- tmux send-keys "./$(basename "$SCRIPT")"
+ if [[ -f "$SCRIPT" ]]; then
+ tmux send-keys "./$(basename "$SCRIPT")"
+ else
+ tmux send-keys "$SCRIPT"
+ fi
fi
# Select consumer pane.