-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.bat
More file actions
80 lines (71 loc) · 2.18 KB
/
Build.bat
File metadata and controls
80 lines (71 loc) · 2.18 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
@echo off
chcp 65001 >nul
title NoteForge Builder
cd /d "%~dp0"
echo ============================================
echo NoteForge - Build
echo ============================================
echo.
echo RECOMMENDED: Push a git tag to build the
echo installer via GitHub Actions:
echo.
echo git tag v2.6.1
echo git push origin v2.6.1
echo.
echo The installer will appear on the Releases
echo page automatically.
echo ============================================
echo.
set CSC_IDENTITY_AUTO_DISCOVERY=false
where node >nul 2>&1
if %errorlevel% neq 0 (
echo [ERROR] Node.js is not installed.
echo Download from https://nodejs.org/
pause
exit /b 1
)
if not exist "node_modules" (
echo Installing dependencies...
call npm install --no-audit --no-fund --loglevel=error
if %errorlevel% neq 0 (echo [ERROR] npm install failed. & pause & exit /b 1)
)
echo.
echo Compiling JSX...
call npx babel app.jsx --out-file app.js --presets=@babel/preset-react
if %errorlevel% neq 0 (echo [ERROR] JSX compile failed. & pause & exit /b 1)
echo.
echo Building installer (requires Developer Mode or Admin)...
echo Enable Developer Mode: Settings -^> System -^> For developers
echo.
:: Clear corrupted signing cache
if exist "%LOCALAPPDATA%\electron-builder\Cache\winCodeSign" (
rd /s /q "%LOCALAPPDATA%\electron-builder\Cache\winCodeSign" 2>nul
)
call npx electron-builder --win
if %errorlevel% neq 0 (
echo.
echo ============================================
echo Local build failed.
echo.
echo This usually means Developer Mode is not
echo enabled. You have two options:
echo.
echo 1. Enable Developer Mode in Windows:
echo Settings -^> System -^> For developers
echo Then run Build.bat again.
echo.
echo 2. Use GitHub Actions instead (recommended):
echo git tag v2.6.1
echo git push origin v2.6.1
echo ============================================
pause
exit /b 1
)
echo.
echo ============================================
echo Build complete!
echo Output: dist\
echo ============================================
set /p open="Open dist folder? (Y/N): "
if /i "%open%"=="Y" explorer "dist"
pause