#!/usr/bin/env bash

# HubLaunch TypeScript CLI wrapper
# This script runs the compiled TypeScript CLI

set -e

# Get the directory where this script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLI_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"

# Check if dist directory exists
if [ ! -d "$CLI_DIR/dist" ]; then
    echo "Error: TypeScript CLI not built yet."
    echo "Run: cd $CLI_DIR && npm run build"
    exit 1
fi

# Run the TypeScript CLI with node
exec node "$CLI_DIR/dist/index.js" "$@"
