-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmake.bat
More file actions
executable file
·83 lines (69 loc) · 2.06 KB
/
make.bat
File metadata and controls
executable file
·83 lines (69 loc) · 2.06 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@echo off
setlocal enabledelayedexpansion enableextensions
rem -------------------------------------------------------------
rem AI Code Fusion - Build Script for Windows
rem -------------------------------------------------------------
rem Ensure we're in the correct directory
set "MAKE_ROOT=%~dp0"
cd /d "%MAKE_ROOT%"
rem Make scripts executable if coming from Unix/WSL
if exist ".git" (
git update-index --chmod=+x scripts/index.js >nul 2>&1
git update-index --chmod=+x scripts/lib/*.js >nul 2>&1
)
rem Special handling for release command to pass version
if /i "%1"=="release" (
if "%2"=="" (
echo Error: Version argument is required for release command
echo Usage: make release ^<version^>
echo Example: make release 1.0.0
exit /b 1
)
scripts\index.js release %2
exit /b %errorlevel%
)
rem Special handling for sonar command on Windows
if /i "%1"=="sonar" (
echo Running: npm run sonar
rem Check if .env file exists and load it
if exist ".env" (
echo Loading environment variables from .env file
for /F "tokens=*" %%A in (.env) do (
set line=%%A
if not "!line:~0,1!"=="#" (
for /f "tokens=1,2 delims==" %%G in ("!line!") do (
set "%%G=%%H"
)
)
)
) else (
echo Warning: .env file not found
)
npm run sonar
exit /b %errorlevel%
)
rem Special handling for dev command on Windows
if /i "%1"=="dev" (
echo Starting development environment for Windows...
rem Set environment variables
set NODE_ENV=development
rem Cleanup
echo Cleanup...
call npm run clean
rem Build CSS if needed
if not exist "src\renderer\output.css" (
echo Building CSS...
call npm run build:css
)
rem Build webpack bundle if needed
if not exist "src\renderer\index.js" (
echo Building webpack bundle...
call npm run build:webpack
)
echo Starting development server...
npx concurrently --kill-others "npm:watch:css" "npm:watch:webpack" "npx electron ."
exit /b %errorlevel%
)
rem Run the command through our unified Node.js script
node scripts/index.js %*
exit /b %errorlevel%