Files
tg_tinder_bot/scripts/startup.sh
2025-09-18 16:37:45 +09:00

35 lines
1.0 KiB
Bash

#!/bin/sh
# startup.sh - Script to run migrations and start the bot
echo "🚀 Starting Telegram Tinder Bot..."
# Check for locales directory
if [ ! -d "dist/locales" ]; then
echo "⚠️ Locales directory not found in dist/locales"
echo "🔍 Checking source directory structure..."
ls -la dist/ || echo "Error listing dist directory"
# If src/locales exists, copy it to dist/locales
if [ -d "src/locales" ]; then
echo "📂 Found src/locales directory. Copying to dist/locales..."
mkdir -p dist/locales
cp -R src/locales/* dist/locales/
echo "✅ Locales copied successfully"
else
echo "❌ src/locales directory not found either. Creating empty locales directory..."
mkdir -p dist/locales
fi
fi
# Wait for database to be ready
echo "⏳ Waiting for database to be ready..."
sleep 5
# Run database migrations
echo "🔄 Running database migrations..."
node dist/database/migrateOnStartup.js
# Start the bot
echo "✅ Starting the bot..."
node dist/bot.js