Newer
Older
cortex-hub / setup.sh
#!/bin/bash

# Check the operating system
OS="$(uname -s)"

# --- Setup for macOS ---
if [ "$OS" == "Darwin" ]; then
    echo "Detected macOS. Using Homebrew for setup."

    # Check for Homebrew, install if not present
    if ! command -v brew &> /dev/null; then
        echo "Homebrew not found. Please install it first:"
        echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
        exit 1
    fi

    echo "Updating Homebrew..."
    brew update

    echo "Installing Node.js..."
    brew install node

# --- Setup for Linux (Debian/Ubuntu) ---
elif [ "$OS" == "Linux" ]; then
    echo "Detected Linux. Assuming Debian/Ubuntu-based system for setup."

    # Update package list
    sudo apt-get update

    # Install curl if not installed
    if ! command -v curl &> /dev/null; then
        sudo apt-get install -y curl
    fi

    # Download and run NodeSource setup script for Node.js 18.x
    curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

    # Install Node.js
    sudo apt-get install -y nodejs

else
    echo "Unsupported operating system: $OS"
    exit 1
fi

# --- Common Steps ---
# Check versions installed
node -v
npm -v
pip install -e ./ai-hub

# Install concurrently globally
echo "Installing concurrently globally..."
npm install -g concurrently

echo "Setup complete!"