#!/bin/zsh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
if ! command -v xcrun >/dev/null 2>&1; then
  echo "Xcode Command Line Tools fehlen. Bitte Xcode installieren."
  read -k 1
  exit 1
fi
OUT="$SCRIPT_DIR/build"
mkdir -p "$OUT"
xcrun safari-web-extension-converter "$SCRIPT_DIR/web-extension" \
  --project-location "$OUT" \
  --app-name "Vendoo Link" \
  --bundle-identifier "local.vendoo.link" \
  --copy-resources
open "$OUT"
