#!/usr/bin/env bash
set -euo pipefail

ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
APP_DIR="$ROOT_DIR/app"

if ! command -v flutter >/dev/null 2>&1; then
  echo "flutter command not found. Install Flutter SDK before creating the app skeleton." >&2
  exit 127
fi

if [ -d "$APP_DIR" ]; then
  echo "app directory already exists: $APP_DIR" >&2
  exit 0
fi

flutter create \
  --platforms=android,ios \
  --org kr.co.baron \
  --project-name tdc114plus \
  "$APP_DIR"
