#!/bin/bash

# Create necessary directories
mkdir -p data/jobsdb
mkdir -p bin

# Build the job test
echo "Building job test..."
go build -o bin/jobtest cmd/jobtest/main.go

# Check if build was successful
if [ $? -ne 0 ]; then
    echo "Build failed"
    exit 1
fi

# Run the job test
echo "Running job test..."
./bin/jobtest

# Exit with the same status as the job test
exit $?