Commit 0d9fcadb authored by Hoanganhvu123's avatar Hoanganhvu123

cleanup: remove unnecessary config and script files

parent cb91fb13
stages:
- deploy
deploy_to_server:
stage: deploy
# Chế độ shell chạy trực tiếp trên host
script:
- echo "🚀 Bắt đầu quá trình Deploy Sạch..."
- export DOCKER_BUILDKIT=1
- "if [ -f /home/anhvh/canifa_soure/chatbot-canifa/backend/.env ]; then cp /home/anhvh/canifa_soure/chatbot-canifa/backend/.env backend/.env; fi"
- cd backend
- docker stop canifa_backend || true
- docker rm -f canifa_backend || true
- docker compose -p canifa-chatbot down --remove-orphans || true
- docker compose -p canifa-chatbot up --build -d
- docker system prune -f
- echo "✅ Web ĐÃ CẬP NHẬT THÀNH CÔNG!"
only:
- master
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
# Deployment Guide
Hướng dẫn deploy CuCu Note lên server production.
## 🚀 Quick Deploy với Docker Compose
### 1. Chuẩn bị Server
```bash
# Cài đặt Docker và Docker Compose
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Hoặc trên Ubuntu/Debian
sudo apt-get update
sudo apt-get install docker.io docker-compose-plugin
```
### 2. Clone Repository
```bash
git clone https://github.com/Hoanganhvu123/cuccu_note.git
cd cuccu_note
```
### 3. Cấu hình Environment Variables
**Backend `.env`** (`backend/.env`):
```bash
# MongoDB
MONGODB_URI=mongodb://mongodb:27017
MONGODB_DB_NAME=cucu_note
# Authentication
CLERK_SECRET_KEY=sk_live_your_production_key
CLERK_JWKS_URL=https://your-clerk-instance.clerk.accounts.dev/.well-known/jwks.json
CLERK_ISSUER=https://your-clerk-instance.clerk.accounts.dev
# OpenAI
OPENAI_API_KEY=sk-your-openai-key
# Encryption (QUAN TRỌNG!)
# Generate: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
ENCRYPTION_KEY=your-generated-32-byte-base64-key
# Server
PORT=5000
# Redis
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_CACHE_URL=redis
RATE_STORAGE_URI=redis://redis:6379/0
# CORS (QUAN TRỌNG: Không dùng * trong production!)
CORS_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
# Production settings
DISABLE_AUTH=false
```
**Frontend `.env`** (`frontend/.env`):
```bash
VITE_API_BASE_URL=https://api.yourdomain.com
```
### 4. Deploy
```bash
# Build và start tất cả services
docker-compose up -d
# Xem logs
docker-compose logs -f
# Kiểm tra status
docker-compose ps
```
### 5. Cấu hình Nginx Reverse Proxy (Optional)
Tạo file `/etc/nginx/sites-available/cuccu-note`:
```nginx
# Backend API
server {
listen 80;
server_name api.yourdomain.com;
location / {
proxy_pass http://localhost:5000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
# Frontend
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
location / {
proxy_pass http://localhost:3001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```
Enable site:
```bash
sudo ln -s /etc/nginx/sites-available/cuccu-note /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
```
### 6. SSL với Let's Encrypt
```bash
sudo apt-get install certbot python3-certbot-nginx
sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com -d api.yourdomain.com
```
## 🔧 Maintenance Commands
```bash
# Restart services
docker-compose restart
# Stop services
docker-compose stop
# Start services
docker-compose start
# Rebuild after code changes
docker-compose up -d --build
# View logs
docker-compose logs -f backend
docker-compose logs -f frontend
# Backup MongoDB
docker exec cuccu_mongodb mongodump --out /data/backup
# Restore MongoDB
docker exec -i cuccu_mongodb mongorestore /data/backup
```
## 📊 Monitoring
### Health Checks
- Backend: `http://localhost:5000/docs`
- Frontend: `http://localhost:3001`
- MongoDB: `docker exec cuccu_mongodb mongosh --eval "db.adminCommand('ping')"`
- Redis: `docker exec cuccu_redis redis-cli ping`
### Logs
```bash
# All logs
docker-compose logs
# Specific service
docker-compose logs backend
docker-compose logs frontend
# Follow logs
docker-compose logs -f
```
## 🔒 Security Checklist
- [ ] `ENCRYPTION_KEY` được set và không commit vào git
- [ ] `CORS_ORIGINS` chỉ cho phép domain của bạn (không dùng `*`)
- [ ] `DISABLE_AUTH=false` trong production
- [ ] `CLERK_SECRET_KEY` là production key (không phải test key)
- [ ] MongoDB có authentication enabled
- [ ] Redis có password (nếu cần)
- [ ] SSL/HTTPS được cấu hình
- [ ] Firewall chỉ mở ports cần thiết
- [ ] Regular backups được setup
- [ ] Monitoring và alerting được cấu hình
## 🚨 Troubleshooting
### Backend không start
```bash
# Check logs
docker-compose logs backend
# Check MongoDB connection
docker exec cuccu_backend python -c "from common.mongo_client import mongodb_client; import asyncio; asyncio.run(mongodb_client.connect())"
```
### Frontend không build
```bash
# Check Node version
docker exec cuccu_frontend node --version
# Rebuild
docker-compose build --no-cache frontend
```
### MongoDB connection issues
```bash
# Check MongoDB status
docker exec cuccu_mongodb mongosh --eval "db.adminCommand('ping')"
# Check network
docker network inspect cuccu_network
```
## 📈 Scaling
### Horizontal Scaling
Để scale backend:
```bash
docker-compose up -d --scale backend=3
```
### Load Balancer
Sử dụng Nginx hoặc Traefik làm load balancer cho multiple backend instances.
## 🔄 Updates
```bash
# Pull latest code
git pull origin main
# Rebuild và restart
docker-compose up -d --build
# Migrate database (nếu có)
docker exec cuccu_backend python -m alembic upgrade head
```
task: "Refactor backend: tách rõ API routes, dọn dead code trong agent module"
test_command: "cd backend && pytest"
---
# Task: Loop vô hạn dọn dẹp backend CuCu
Mục tiêu:
- **Loop vô hạn** cho đến khi backend gọn gàng, tối giản, dễ scale, chuẩn senior nhất có thể.
- Dọn dẹp backend FastAPI + agent cho gọn, dễ đọc, dễ scale.
- Giảm nợ kỹ thuật, chuẩn hóa kiến trúc và cấu trúc module.
- Đảm bảo test backend chạy xanh, hạn chế regression.
- Code phải đạt chuẩn senior: clean, maintainable, scalable.
## Success Criteria
### 1. Kiến trúc & cấu trúc mã nguồn <!-- group: 1 -->
- [ ] API backend được tổ chức rõ ràng:
- `backend/api/memos``backend/api/chatbot` tách bạch trách nhiệm.
- Không còn logic business nặng nằm lẫn trong route handler.
- [ ] Module agent (`backend/agent/*`) được dọn:
- Graph, tools, controller, helper tách vai trò rõ.
- Không còn import dead code / module không dùng.
- [ ] Các singleton/service quan trọng (Mongo client, ConversationManager, LLM factory, cache) có một nơi khởi tạo rõ ràng, tránh duplicate logic.
- [ ] Đường dẫn, tên file, tên hàm tuân thủ convention nhất quán (snake_case cho Python, rõ domain).
### 2. Độ tin cậy & test backend <!-- group: 2 -->
- [ ] Tất cả test trong `backend/tests` pass ổn định với:
- `cd backend && pytest` chạy không lỗi.
- Không thêm test flaky mới (nếu có test flaky cũ, ghi chú rõ trong progress/guardrails).
- [ ] Route `/api/agent/chat` và các route chính của `memos` được cover test:
- Response code đúng.
- Trả về schema hợp lệ, không raise exception không kiểm soát.
- [ ] Các xử lý lỗi quan trọng (validation input, timeout LLM, lỗi DB) đều:
- Bị log lại rõ ràng.
- Trả về HTTP status chuẩn (4xx/5xx) với message dễ debug.
### 3. Hiệu năng & khả năng mở rộng nhẹ nhàng <!-- group: 3 -->
- [ ] Các đoạn code có nguy cơ N+1 hoặc vòng lặp lớn đã được rà soát:
- Tránh query DB trong loop nếu không cần.
- Dùng batch/aggregation khi hợp lý.
- [ ] Những chỗ cache phù hợp (ví dụ embedding, metadata ít đổi) tận dụng được `common/cache.py` hoặc service tương tự.
- [ ] Các config quan trọng (model name, timeout, limit, feature flag) đọc từ cấu hình trung tâm (`config.py` / env), không hard-code rải rác.
### 4. Developer Experience & guardrails <!-- group: 4 -->
- [ ] Có hướng dẫn ngắn gọn trong `backend/readme.md` hoặc README chính:
- Cách chạy server backend.
- Cách chạy test: `cd backend && pytest`.
- Các env quan trọng cần set khi dev/test.
- [ ] `.ralph/guardrails.md` được cập nhật nếu backend/agent hay dính lỗi lặp lại:
- Ví dụ: truy cập DB khi chưa init Mongo, quên await async, quên commit transaction, v.v.
- [ ] Mọi file backend được sửa trong task này đều:
- Được format/lint theo rule chuẩn (ví dụ: ruff/black hoặc tool tương đương nếu đã cấu hình trong repo).
## Context / Gợi ý cho Agent
- Luôn đọc các skill sau trước khi thay đổi nhiều:
- `.cursor/skills/cucu-python-backend/SKILL.md`
- `.cursor/skills/cucu-api-design/SKILL.md`
- `.cursor/skills/cucu-testing/SKILL.md`
- `.cursor/rules/backend-python.md` (nếu tồn tại).
- Không thay đổi triết lý sản phẩm:
- Backend phục vụ app note đơn giản, tập trung vào ổn định và dễ mở rộng, không over-engineer.
- Ưu tiên:
- Làm thay đổi nhỏ, an toàn, kèm test, commit thường xuyên.
- Khi đụng code phức tạp, thêm comment ngắn gọn giải thích ý đồ thay vì refactor “all-in-one” nếu không cần.
#!/usr/bin/env bash
# Color support: check NO_COLOR or non-TTY (stdout)
if [ -n "${NO_COLOR+x}" ] || [ ! -t 1 ]; then
CYAN=''
GREEN=''
YELLOW=''
BLUE=''
PURPLE=''
RED=''
BOLD=''
DIM=''
NC=''
else
CYAN='\033[0;36m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
RED='\033[0;31m'
BOLD='\033[1m'
DIM='\033[2m'
NC='\033[0m'
fi
# Fancy header
echo ""
echo -e "${BOLD}Cursor Agent Installer${NC}"
echo ""
# Function to print steps with style
print_step() {
echo -e "${BLUE}${NC} ${1}"
}
# Function to print success
print_success() {
# Move cursor up one line and clear it
echo -ne "\033[1A\033[2K"
echo -e "${GREEN}${NC} ${1}"
}
# Function to print error
print_error() {
echo -e "${RED}${NC} ${1}"
}
# Detect OS and Architecture
print_step "Detecting system architecture..."
# Detect OS
OS="$(uname -s)"
case "${OS}" in
Linux*) OS="linux";;
Darwin*) OS="darwin";;
*)
print_error "Unsupported operating system: ${OS}"
exit 1
;;
esac
# Detect Architecture
ARCH="$(uname -m)"
case "${ARCH}" in
x86_64|amd64) ARCH="x64";;
arm64|aarch64) ARCH="arm64";;
*)
print_error "Unsupported architecture: ${ARCH}"
exit 1
;;
esac
print_success "Detected ${OS}/${ARCH}"
# Installation steps
print_step "Creating installation directory..."
# Create temporary directory for atomic download inside versions folder
TEMP_EXTRACT_DIR="$HOME/.local/share/cursor-agent/versions/.tmp-2026.01.28-fd13201-$(date +%s)"
mkdir -p "${TEMP_EXTRACT_DIR}"
print_success "Directory created"
print_step "Downloading Cursor Agent package..."
DOWNLOAD_URL="https://downloads.cursor.com/lab/2026.01.28-fd13201/${OS}/${ARCH}/agent-cli-package.tar.gz"
echo -e "${DIM} Download URL: ${DOWNLOAD_URL}${NC}"
# Cleanup function
cleanup() {
rm -rf "${TEMP_EXTRACT_DIR}"
}
trap cleanup EXIT
# Download with progress bar and better error handling
if curl -fSL --progress-bar "${DOWNLOAD_URL}" \
| tar --strip-components=1 -xzf - -C "${TEMP_EXTRACT_DIR}"; then
echo -ne "\033[1A\033[2K"
echo -ne "\033[1A\033[2K"
echo -ne "\033[1A\033[2K"
print_success "Package downloaded and extracted"
else
print_error "Download failed. Please check your internet connection and try again."
print_error "If the problem persists, the package might not be available for ${OS}/${ARCH}."
cleanup
exit 1
fi
print_step "Finalizing installation..."
# Atomically move from temp to final destination
FINAL_DIR="$HOME/.local/share/cursor-agent/versions/2026.01.28-fd13201"
rm -rf "${FINAL_DIR}"
if mv "${TEMP_EXTRACT_DIR}" "${FINAL_DIR}"; then
print_success "Package installed successfully"
else
print_error "Failed to install package. Please check permissions."
cleanup
exit 1
fi
print_step "Creating bin directory..."
mkdir -p ~/.local/bin
print_success "Bin directory ready"
print_step "Creating symlinks to agent executable..."
# Remove any existing symlink or file
rm -f ~/.local/bin/agent ~/.local/bin/cursor-agent
# Create symlinks to the Cursor Agent executable (primary: agent, legacy: cursor-agent)
ln -s ~/.local/share/cursor-agent/versions/2026.01.28-fd13201/cursor-agent ~/.local/bin/agent
ln -s ~/.local/share/cursor-agent/versions/2026.01.28-fd13201/cursor-agent ~/.local/bin/cursor-agent
print_success "Symlink created"
# Success message
echo ""
echo -e "${BOLD}${GREEN}✨ Installation Complete! ${NC}"
echo ""
echo ""
# Check if ~/.local/bin is already in PATH
if [[ ":${PATH}:" == *":${HOME}/.local/bin:"* ]]; then
# PATH already configured, just show usage
echo -e "${BOLD}Start using Cursor Agent:${NC}"
echo -e " ${BOLD}agent${NC}"
else
# Determine configured shells
CURRENT_SHELL="$(basename $SHELL)"
SHOW_BASH=false
SHOW_ZSH=false
SHOW_FISH=false
case "${CURRENT_SHELL}" in
bash) SHOW_BASH=true ;;
zsh) SHOW_ZSH=true ;;
fish) SHOW_FISH=true ;;
esac
# Also consider presence of config files as configured
if [ -f "$HOME/.bashrc" ] || [ -f "$HOME/.bash_profile" ]; then SHOW_BASH=true; fi
if [ -f "$HOME/.zshrc" ]; then SHOW_ZSH=true; fi
if [ -f "$HOME/.config/fish/config.fish" ]; then SHOW_FISH=true; fi
# Next steps with style
echo -e "${BOLD}Next Steps${NC}"
echo ""
echo -e "${BOLD}1.${NC} Add ~/.local/bin to your PATH:"
if [ "${SHOW_BASH}" = true ]; then
echo -e " ${DIM}For bash:${NC}"
echo -e " ${BOLD}${BLUE}echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.bashrc${NC}"
echo -e " ${BOLD}${BLUE}source ~/.bashrc${NC}"
echo ""
fi
if [ "${SHOW_ZSH}" = true ]; then
echo -e " ${DIM}For zsh:${NC}"
echo -e " ${BOLD}${BLUE}echo 'export PATH=\"\$HOME/.local/bin:\$PATH\"' >> ~/.zshrc${NC}"
echo -e " ${BOLD}${BLUE}source ~/.zshrc${NC}"
echo ""
fi
if [ "${SHOW_FISH}" = true ]; then
echo -e " ${DIM}For fish:${NC}"
echo -e " ${BOLD}${BLUE}mkdir -p \$HOME/.config/fish${NC}"
echo -e " ${BOLD}${BLUE}echo 'fish_add_path \$HOME/.local/bin' >> \$HOME/.config/fish/config.fish${NC}"
echo -e " ${BOLD}${BLUE}source \$HOME/.config/fish/config.fish${NC}"
echo ""
fi
# Fallback if no known shells detected/configured
if [ "${SHOW_BASH}" != true ] && [ "${SHOW_ZSH}" != true ] && [ "${SHOW_FISH}" != true ]; then
echo -e " ${DIM}Add to PATH manually:${NC}"
echo -e " ${BOLD}${BLUE}export PATH=\"\$HOME/.local/bin:\$PATH\"${NC}"
echo ""
fi
echo -e "${BOLD}2.${NC} Start using Cursor Agent:"
echo -e " ${BOLD}agent${NC}"
fi
echo ""
echo ""
echo -e "${BOLD}${CYAN}Happy coding! 🚀${NC}"
echo ""
\ No newline at end of file
@echo off
git add -A
git commit -m "cleanup: remove unnecessary config and script files"
git push origin main
del "%~f0"
#!/usr/bin/env bash
set -euo pipefail
echo "=== Ralph backend hardening loop ==="
# 1. Ensure we're at repo root
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# 2. Ensure git repo
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "⚠️ Not in a git repo. Initializing..."
git init
fi
# 3. Ensure RALPH_TASK.md exists
if [[ ! -f "RALPH_TASK.md" ]]; then
echo "❌ RALPH_TASK.md không tồn tại. Hãy gọi lại Cursor để tạo task trước."
exit 1
fi
# 4. Install Ralph scripts if missing
if [[ ! -f ".cursor/ralph-scripts/ralph-loop.sh" ]]; then
echo "📦 Ralph scripts chưa có. Đang cài đặt..."
curl -fsSL https://raw.githubusercontent.com/agrimsingh/ralph-wiggum-cursor/main/install.sh | bash
fi
# 5. Check cursor-agent
if ! command -v cursor-agent >/dev/null 2>&1; then
echo "❌ cursor-agent CLI chưa cài."
echo " Cài bằng lệnh:"
echo " curl https://cursor.com/install -fsS | bash"
exit 1
fi
# 6. Run Ralph loop on backend task
BRANCH_NAME="feature/ralph-backend-cleanup"
MAX_ITERS="${MAX_ITERATIONS:-200}"
MODEL_NAME="${RALPH_MODEL:-gpt-5.2-high}"
echo "🚀 Starting Ralph loop on branch: $BRANCH_NAME"
echo " Max iterations: $MAX_ITERS"
echo " Model: $MODEL_NAME"
./.cursor/ralph-scripts/ralph-loop.sh \
-n "$MAX_ITERS" \
-m "$MODEL_NAME" \
--branch "$BRANCH_NAME" \
--pr -y
echo "✅ Ralph loop finished or reached max iterations."
echo " Kiểm tra diff + PR trên branch: $BRANCH_NAME"
# Ralph Wiggum: Windows PowerShell Runner
#
# Main entry point for running Ralph on Windows
# This script handles the Windows-specific workaround
param(
[int]$MaxIterations = 200,
[string]$Model = "gpt-5.2-high",
[string]$Branch = "feature/ralph-backend-cleanup"
)
$ErrorActionPreference = "Stop"
Write-Host "═══════════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host "🚀 Ralph Backend Hardening Loop (Windows)" -ForegroundColor Cyan
Write-Host "═══════════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
$Workspace = (Get-Location).Path
$TaskFile = Join-Path $Workspace "RALPH_TASK.md"
# Check prerequisites
if (-not (Test-Path $TaskFile)) {
Write-Host "❌ RALPH_TASK.md not found. Please create it first." -ForegroundColor Red
exit 1
}
# Check if git repo
try {
git rev-parse --git-dir 2>$null | Out-Null
if ($LASTEXITCODE -ne 0) {
Write-Host "⚠️ Not in a git repo. Initializing..." -ForegroundColor Yellow
git init
}
} catch {
Write-Host "⚠️ Git not found. Please install Git for Windows." -ForegroundColor Yellow
}
Write-Host "Workspace: $Workspace" -ForegroundColor Green
Write-Host "Max Iterations: $MaxIterations" -ForegroundColor Green
Write-Host "Model: $Model" -ForegroundColor Green
Write-Host "Branch: $Branch" -ForegroundColor Green
Write-Host ""
# Check if WSL is available
$WSLAvailable = $false
try {
wsl --list --quiet 2>$null | Out-Null
if ($LASTEXITCODE -eq 0) {
$WSLAvailable = $true
Write-Host "✅ WSL detected! You can run bash scripts via WSL." -ForegroundColor Green
Write-Host ""
Write-Host "To run Ralph via WSL:" -ForegroundColor Cyan
Write-Host " wsl bash -c `"cd /mnt/e/opennotion && ./.cursor/ralph-scripts/ralph-once.sh`"" -ForegroundColor White
Write-Host ""
}
} catch {
Write-Host "⚠️ WSL not detected. Using Cursor chat method instead." -ForegroundColor Yellow
}
Write-Host "═══════════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host "📝 Recommended Approach for Windows" -ForegroundColor Cyan
Write-Host "═══════════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
Write-Host "Since cursor-agent CLI is not available on Windows, use one of:" -ForegroundColor Yellow
Write-Host ""
Write-Host "Option 1: Use Cursor Chat (Recommended)" -ForegroundColor Cyan
Write-Host "─────────────────────────────────────────────────────────────────" -ForegroundColor Gray
Write-Host "1. In Cursor IDE, open this workspace" -ForegroundColor White
Write-Host "2. Use command: /ralph-loop" -ForegroundColor White
Write-Host "3. The agent will work on RALPH_TASK.md iteratively" -ForegroundColor White
Write-Host ""
Write-Host "Option 2: Use WSL (if available)" -ForegroundColor Cyan
Write-Host "─────────────────────────────────────────────────────────────────" -ForegroundColor Gray
if ($WSLAvailable) {
Write-Host "Run in WSL:" -ForegroundColor White
Write-Host " wsl bash -c `"cd /mnt/e/opennotion && MAX_ITERATIONS=$MaxIterations RALPH_MODEL=$Model bash run_ralph_backend.sh`"" -ForegroundColor Cyan
} else {
Write-Host "Install WSL first: wsl --install" -ForegroundColor White
Write-Host "Then run bash scripts in WSL environment" -ForegroundColor White
}
Write-Host ""
Write-Host "Option 3: Manual Iteration" -ForegroundColor Cyan
Write-Host "─────────────────────────────────────────────────────────────────" -ForegroundColor Gray
Write-Host "1. Review RALPH_TASK.md" -ForegroundColor White
Write-Host "2. Use Cursor's built-in agent to work on unchecked criteria" -ForegroundColor White
Write-Host "3. Test: cd backend && pytest" -ForegroundColor White
Write-Host "4. Commit changes" -ForegroundColor White
Write-Host "5. Repeat until all criteria are checked" -ForegroundColor White
Write-Host ""
Write-Host "═══════════════════════════════════════════════════════════════════" -ForegroundColor Cyan
Write-Host ""
# Create/update branch if needed
try {
$CurrentBranch = git rev-parse --abbrev-ref HEAD 2>$null
if ($CurrentBranch -ne $Branch) {
Write-Host "📦 Creating/switching to branch: $Branch" -ForegroundColor Cyan
git checkout -b $Branch 2>$null
if ($LASTEXITCODE -ne 0) {
git checkout $Branch 2>$null
}
}
} catch {
Write-Host "⚠️ Could not create branch. Continuing on current branch." -ForegroundColor Yellow
}
Write-Host ""
Write-Host "✅ Setup complete!" -ForegroundColor Green
Write-Host " Choose one of the options above to proceed." -ForegroundColor Green
Write-Host ""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment