#!/bin/bash

echo "FFAIR.GIFTS Node.js Diagnostic Script"
echo "====================================="
echo "Running comprehensive Node.js environment test..."
echo ""

# Make the test script executable
chmod +x test-nodejs.js

# Run the diagnostic test and capture output
echo "Starting diagnostic test at $(date)"
echo ""

# Run the test and save output to a file
node test-nodejs.js > diagnostic-output.txt 2>&1

# Display the results
cat diagnostic-output.txt

echo ""
echo "====================================="
echo "Diagnostic test completed at $(date)"
echo "Full output saved to: diagnostic-output.txt"
echo ""
echo "Please send the contents of diagnostic-output.txt to the customer"
echo "or provide the output above for analysis." 