resume/tests/pre-test-setup.sh

36 lines
1021 B
Bash
Executable File

#!/bin/bash
# =====================================================================
# pre-test-setup.sh - Setup for tests
# =====================================================================
# This script sets up the environment for testing
# =====================================================================
set -e # Exit on any error
TESTS_DIR="$(dirname "$0")"
RESUME_DIR="$(pwd)/docker/resume"
echo "=== Setting Up Test Environment ==="
# Check if we're in the correct directory
if [ ! -d "$RESUME_DIR" ]; then
echo "Error: Could not find the resume directory at $RESUME_DIR"
echo "Make sure you're running this script from the project root"
exit 1
fi
# Run the CSP hash update script
echo "Running CSP hash update script..."
cd "$RESUME_DIR"
if [ -f "./update-csp-hashes.sh" ]; then
./update-csp-hashes.sh
else
echo "Error: Could not find update-csp-hashes.sh script"
exit 1
fi
# Return to the original directory
cd - > /dev/null
echo "=== Test Environment Setup Complete ==="