#!/usr/bin/env bash

set -eo pipefail

# Check if the AWS CLI is installed
if ! command -v aws &> /dev/null
then
    echo "AWS CLI not found. Please install it to proceed."
    exit 1
fi

echo "AWS CLI is installed."

aws configure set s3.max_concurrent_requests 50
aws s3 cp out/ "s3://$ARTIFACTS_S3_BUCKET/$S3_UPLOAD_PATH/" --acl public-read --recursive --no-progress

echo -e "\n\033[1m==> Download index file: \033[36mhttps://$ARTIFACTS_S3_BUCKET.s3.amazonaws.com/$S3_UPLOAD_PATH/index.html\033[0m\n"
