#!/usr/bin/env bash

SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd "$SCRIPTPATH" || exit

container_id=$(docker create "aichat-build")
docker cp "${container_id}:/usr/local/cargo/bin/aichat" "./tools/"
docker rm "${container_id}"

source .env
mkdir -p ~/.config/aichat/
cat src/aichat/config.yaml | sed "s/__LLM_API_KEY__/${LLM_API_KEY}/" > ~/.config/aichat/config.yaml
