Prioritize same path first

This commit is contained in:
Peter Steinberger 2025-06-20 14:24:16 +02:00
parent d0e92ea932
commit 014bbb9e1e

View file

@ -2,7 +2,7 @@
# vt - VibeTunnel CLI wrapper
# Simple bash wrapper that passes through to vibetunnel with shell expansion
VERSION="1.0.4"
VERSION="1.0.5"
# Handle version flag
if [ "$1" = "--version" ] || [ "$1" = "-v" ]; then
@ -11,8 +11,12 @@ if [ "$1" = "--version" ] || [ "$1" = "-v" ]; then
fi
# Find vibetunnel binary (prefer Go implementation)
# First check if vibetunnel is in PATH (most common after installation)
if command -v vibetunnel >/dev/null 2>&1; then
# First check in the same directory as this script (when installed together)
SCRIPT_DIR="$(dirname "$0")"
if [ -x "$SCRIPT_DIR/vibetunnel" ]; then
VIBETUNNEL="$SCRIPT_DIR/vibetunnel"
elif command -v vibetunnel >/dev/null 2>&1; then
# Check if vibetunnel is in PATH
VIBETUNNEL="vibetunnel"
elif [ -x "/usr/local/bin/vibetunnel" ]; then
VIBETUNNEL="/usr/local/bin/vibetunnel"