#!/bin/bash

# RARN v1.1.0 Environment Demo
# This script demonstrates the new environment features

echo "=== RARN Environment Demo ==="
echo "This demo shows the new environment activation features in v1.1.0"
echo ""

# Create a demo environment
echo "1. Creating a new environment with JavaScript and Python support..."
rarn env create demo-env --language javascript python
echo ""

# Show activation instructions
echo "2. Showing activation instructions..."
rarn env activate demo-env
echo ""

# Demonstrate activation
echo "3. To activate the environment in your shell, run:"
echo "   eval \"\$(rarn env activate demo-env --print)\""
echo ""

echo "4. Once activated, you'll see:"
echo "   - Your prompt changes to: (demo-env) $"
echo "   - Packages install to the environment"
echo "   - Python uses the environment's venv"
echo ""

echo "5. Example workflow:"
echo "   (demo-env) $ rarn install express axios"
echo "   (demo-env) $ rarn install python:requests python:flask"
echo "   (demo-env) $ node app.js  # Uses environment's node_modules"
echo "   (demo-env) $ python script.py  # Uses environment's Python"
echo ""

echo "6. To deactivate:"
echo "   (demo-env) $ rarn_deactivate"
echo ""

echo "7. List all environments:"
rarn env list
echo ""

echo "=== Demo Complete ==="
echo "Try it yourself by running the activation command above!"