-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
42 lines (34 loc) · 1.07 KB
/
setup.sh
File metadata and controls
42 lines (34 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo "🚀 Setting up Post-Dost for contributors..."
# Check Node.js version
echo "📋 Checking Node.js version..."
node_version=$(node -v 2>/dev/null)
if [ $? -ne 0 ]; then
echo "❌ Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
echo "✅ Node.js version: $node_version"
# Install dependencies
echo "📦 Installing dependencies..."
npm install --legacy-peer-deps
if [ $? -ne 0 ]; then
echo "❌ Failed to install dependencies. Trying to clear cache..."
rm -rf node_modules package-lock.json
npm install --legacy-peer-deps
fi
# Setup environment
echo "🔧 Setting up environment..."
if [ ! -f .env.local ]; then
cp .env.example .env.local
echo "✅ Created .env.local from .env.example"
echo "📝 Please edit .env.local with your configuration"
else
echo "✅ .env.local already exists"
fi
# Type check
echo "🔍 Running type check..."
npm run type-check
# Start development server
echo "🎉 Setup complete! Starting development server..."
echo "🌐 Open http://localhost:3000 in your browser"
npm run dev