#!/bin/bash

# Simple Viper Desktop Launcher
# Just finds and runs the app from node_modules

# Look for the app in common node_modules locations
POSSIBLE_PATHS=(
    "$(dirname "$0")/Viper Desktop.app"
    "$(npm root -g)/viper-desktop/Viper Desktop.app"
    "$HOME/node_modules/viper-desktop/Viper Desktop.app"
    "./node_modules/viper-desktop/Viper Desktop.app"
)

APP_PATH=""

# Find the app
for path in "${POSSIBLE_PATHS[@]}"; do
    if [ -d "$path" ]; then
        APP_PATH="$path"
        break
    fi
done

if [ -z "$APP_PATH" ]; then
    echo "Error: Viper Desktop.app not found in node_modules"
    echo "Please run: npm install -g viper-desktop"
    exit 1
fi

# Launch the app
echo "Launching Viper Desktop from: $APP_PATH"
open "$APP_PATH" 