-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
61 lines (50 loc) · 1.39 KB
/
Copy pathstart.bat
File metadata and controls
61 lines (50 loc) · 1.39 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
56
57
58
59
60
61
@echo off
REM filepath: C:\path\to\start.bat
REM Color codes for output messages
set "GREEN=92"
set "RED=91"
echo [%GREEN%mStarting development environment...[0m
REM Get current branch name
for /f "tokens=*" %%a in ('git branch --show-current') do set CURRENT_BRANCH=%%a
echo [%GREEN%mCurrent branch: %CURRENT_BRANCH%[0m
REM Pull latest changes
echo [%GREEN%mPulling latest changes from %CURRENT_BRANCH%...[0m
git pull origin %CURRENT_BRANCH%
if %ERRORLEVEL% NEQ 0 (
echo [%RED%mFailed to pull latest changes.[0m
exit /b 1
)
REM Install dependencies
echo [%GREEN%mInstalling dependencies...[0m
call npm install
if %ERRORLEVEL% NEQ 0 (
echo [%RED%mFailed to install dependencies.[0m
exit /b 1
)
REM Run prisma generate
echo [%GREEN%mGenerating Prisma client...[0m
REM Change to prisma directory
cd app\prisma
if %ERRORLEVEL% NEQ 0 (
echo [%RED%mFailed to change to prisma directory.[0m
exit /b 1
)
REM First pull the database schema
echo [%GREEN%mPulling database schema...[0m
call npx prisma db pull
if %ERRORLEVEL% NEQ 0 (
echo [%RED%mFailed to pull database schema.[0m
exit /b 1
)
REM Then generate the Prisma client
call npx prisma generate
if %ERRORLEVEL% NEQ 0 (
echo [%RED%mFailed to generate Prisma client.[0m
exit /b 1
)
REM Return to original directory
cd ..\..
REM Start development server
echo [%GREEN%mStarting development server...[0m
call npm run dev
exit /b 0