#!/bin/sh
##
##  claudeX -- Claude Code eXtended
##  Copyright (c) 2026 Dr. Ralf S. Engelschall <rse@engelschall.com>
##  Licensed under GPL 3.0 <https://spdx.org/licenses/GPL-3.0-only>
##
##  Thin POSIX-sh launcher: resolve our own path (handling symlinks),
##  then exec the compiled Node.js program (claudex.js) next to it.
##

#   resolve our own path through any symlinks (e.g. ~/bin/claudex)
self="$0"
while [ -L "$self" ]; do
    target=$(readlink "$self")
    case "$target" in
        /* ) self="$target" ;;
        *  ) self="$(dirname "$self")/$target" ;;
    esac
done
basedir=$(cd "$(dirname "$self")" && pwd)

#   pass-through execution
exec node "$basedir/claudex.js" "$@"

