#!/bin/bash

# Rebrandly AI - Linux/Mac Installation Script
# Run this script to start the installation wizard

echo ""
echo "========================================"
echo "  Rebrandly AI - Installation Wizard"
echo "========================================"
echo ""

# Check if Node.js is installed
if ! command -v node &> /dev/null; then
    echo "[ERROR] Node.js is not installed!"
    echo ""
    echo "Please install Node.js from: https://nodejs.org"
    echo "Download the LTS version (18.x or higher)"
    echo ""
    exit 1
fi

# Check Node.js version
echo "Checking Node.js version..."
node --version
echo ""

# Make install.js executable
chmod +x install.js

# Run the installation wizard
echo "Starting installation wizard..."
echo ""
node install.js

if [ $? -ne 0 ]; then
    echo ""
    echo "[ERROR] Installation failed!"
    echo ""
    exit 1
fi

echo ""
echo "Installation completed successfully!"
echo ""
