#!/bin/bash
set -o errexit

VERSION=${1:-2.4.2}
EDITION=${2:-community}

bin/stop
docker-compose -f docker-compose.yml up -d
[ $? != 0 ] && echo "Failed to start Docker services" && exit

bin/setup-composer-auth

bin/clinotty composer create-project --repository=https://repo.magento.com/ magento/project-"${EDITION}"-edition="${VERSION}" .