Skip to content

Commit 23df8d2

Browse files
committed
Add startup scripts for development environment setup in Windows and Linux
1 parent 0b6a9f4 commit 23df8d2

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

start.bat

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@echo off
2+
REM filepath: C:\path\to\start.bat
3+
4+
REM Color codes for output messages
5+
set "GREEN=92"
6+
set "RED=91"
7+
8+
echo [%GREEN%mStarting development environment...[0m
9+
10+
REM Get current branch name
11+
for /f "tokens=*" %%a in ('git branch --show-current') do set CURRENT_BRANCH=%%a
12+
echo [%GREEN%mCurrent branch: %CURRENT_BRANCH%[0m
13+
14+
REM Pull latest changes
15+
echo [%GREEN%mPulling latest changes from %CURRENT_BRANCH%...[0m
16+
git pull origin %CURRENT_BRANCH%
17+
if %ERRORLEVEL% NEQ 0 (
18+
echo [%RED%mFailed to pull latest changes.[0m
19+
exit /b 1
20+
)
21+
22+
REM Install dependencies
23+
echo [%GREEN%mInstalling dependencies...[0m
24+
call npm install
25+
if %ERRORLEVEL% NEQ 0 (
26+
echo [%RED%mFailed to install dependencies.[0m
27+
exit /b 1
28+
)
29+
30+
REM Start development server
31+
echo [%GREEN%mStarting development server...[0m
32+
call npm run dev
33+
34+
exit /b 0

start.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Color codes for output messages
4+
GREEN='\033[0;32m'
5+
RED='\033[0;31m'
6+
NC='\033[0m' # No Color
7+
8+
echo -e "${GREEN}Starting development environment...${NC}"
9+
10+
# Configure git to ignore file permission changes
11+
echo -e "${GREEN}Configuring git to ignore permission changes...${NC}"
12+
git config core.fileMode false
13+
14+
# Get current branch name
15+
CURRENT_BRANCH=$(git branch --show-current)
16+
echo -e "${GREEN}Current branch: ${CURRENT_BRANCH}${NC}"
17+
18+
# Pull latest changes
19+
echo -e "${GREEN}Pulling latest changes from ${CURRENT_BRANCH}...${NC}"
20+
if ! git pull origin $CURRENT_BRANCH; then
21+
echo -e "${RED}Failed to pull latest changes.${NC}"
22+
exit 1
23+
fi
24+
25+
# Install dependencies
26+
echo -e "${GREEN}Installing dependencies...${NC}"
27+
if ! npm install; then
28+
echo -e "${RED}Failed to install dependencies.${NC}"
29+
exit 1
30+
fi
31+
32+
# Start development server
33+
echo -e "${GREEN}Starting development server...${NC}"
34+
npm run dev

0 commit comments

Comments
 (0)