Initial commit: add .gitignore and README
This commit is contained in:
45
infrastructure/setup.sh
Executable file
45
infrastructure/setup.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
# Workspace Setup Script
|
||||
# Initializes the workspace with required tools and dependencies
|
||||
|
||||
set -e
|
||||
|
||||
# Load shared libraries
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SCRIPT_DIR/../lib/init.sh"
|
||||
|
||||
log_heading "🚀 Setting up workspace..."
|
||||
|
||||
log_step "Checking required tools..."
|
||||
require_command node
|
||||
require_command npm
|
||||
require_command git
|
||||
|
||||
# Check for pnpm
|
||||
if check_command pnpm; then
|
||||
log_success "pnpm is installed"
|
||||
else
|
||||
log_info "Installing pnpm..."
|
||||
npm install -g pnpm
|
||||
log_success "pnpm installed"
|
||||
fi
|
||||
|
||||
# Install workspace dependencies if package.json exists
|
||||
PROJECT_ROOT="$(get_project_root)"
|
||||
if [ -f "$PROJECT_ROOT/package.json" ]; then
|
||||
log_step "Installing workspace dependencies..."
|
||||
cd "$PROJECT_ROOT"
|
||||
pnpm install
|
||||
log_success "Workspace dependencies installed"
|
||||
fi
|
||||
|
||||
# Install root-level dependencies
|
||||
if [ -f "$PROJECT_ROOT/pnpm-workspace.yaml" ]; then
|
||||
log_step "Installing monorepo dependencies..."
|
||||
cd "$PROJECT_ROOT"
|
||||
pnpm install
|
||||
log_success "Monorepo dependencies installed"
|
||||
fi
|
||||
|
||||
log_success "Workspace setup complete!"
|
||||
|
||||
Reference in New Issue
Block a user