#!/bin/bash

# This script sets up the mkdocs environment in the code-server container

# Create a symbolic link to the check script in the container's .local/bin directory
echo "Creating a symbolic link to the mkdocs-check.sh script..."
CODE_SERVER_CONTAINER_ID=$(docker ps -qf "name=code-server-changemaker")

if [ -z "$CODE_SERVER_CONTAINER_ID" ]; then
  echo "Error: code-server container is not running"
  exit 1
fi

# Copy the check script into the container
docker cp /home/bunker-admin/Changemaker/mkdocs-check.sh $CODE_SERVER_CONTAINER_ID:/home/coder/.local/bin/
docker exec -u coder $CODE_SERVER_CONTAINER_ID chmod +x /home/coder/.local/bin/mkdocs-check.sh

echo "Setup complete! You can now use the mkdocs-check.sh script inside the code-server container."
echo "Access it by running: mkdocs-check.sh"
