#!/bin/sh
# dawn, as it comes inside DAWN.app. Updating the app updates this.
self="$0"
while [ -L "$self" ]; do
  link="$(readlink "$self")"
  case "$link" in
    /*) self="$link" ;;
    *) self="$(dirname "$self")/$link" ;;
  esac
done
cli="$(cd "$(dirname "$self")/../cli" 2>/dev/null && pwd -P)" || {
  echo "dawn: the DAWN app this command came with has moved or been deleted. Open DAWN and choose Install Command Line Tool again." >&2
  exit 127
}
DAWN_APP_BUNDLE="$(dirname "$cli")"
export DAWN_APP_BUNDLE
exec "$cli/bun" --config=/dev/null --no-env-file --no-install "$cli/node_modules/@hraness/dawn/src/main.ts" "$@"
