-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
55 lines (47 loc) · 1.45 KB
/
start.sh
File metadata and controls
55 lines (47 loc) · 1.45 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
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# Color codes for output messages
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${GREEN}Starting development environment...${NC}"
# Configure git to ignore file permission changes
echo -e "${GREEN}Configuring git to ignore permission changes...${NC}"
git config core.fileMode false
# Get current branch name
CURRENT_BRANCH=$(git branch --show-current)
echo -e "${GREEN}Current branch: ${CURRENT_BRANCH}${NC}"
# Pull latest changes
echo -e "${GREEN}Pulling latest changes from ${CURRENT_BRANCH}...${NC}"
if ! git pull origin $CURRENT_BRANCH; then
echo -e "${RED}Failed to pull latest changes.${NC}"
exit 1
fi
# Install dependencies
echo -e "${GREEN}Installing dependencies...${NC}"
if ! npm install; then
echo -e "${RED}Failed to install dependencies.${NC}"
exit 1
fi
# Run prisma generate
echo -e "${GREEN}Generating Prisma client...${NC}"
# Change to prisma directory
cd app/prisma || {
echo -e "${RED}Failed to change to prisma directory.${NC}"
exit 1
}
# First pull the database schema
echo -e "${GREEN}Pulling database schema...${NC}"
if ! npx prisma db pull; then
echo -e "${RED}Failed to pull database schema.${NC}"
exit 1
fi
# Then generate the Prisma client
if ! npx prisma generate; then
echo -e "${RED}Failed to generate Prisma client.${NC}"
exit 1
fi
# Return to original directory
cd - > /dev/null
# Start development server
echo -e "${GREEN}Starting development server...${NC}"
npm run dev