-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathelectron_debug.bat
More file actions
51 lines (45 loc) · 1.04 KB
/
electron_debug.bat
File metadata and controls
51 lines (45 loc) · 1.04 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
@ECHO OFF
SETLOCAL
REM Check if npm is installed
where npm >nul 2>nul
IF %errorlevel%==1 (
CALL :installNode
) ELSE (
CALL :runElectron
)
GOTO :EOF
:installNode
ECHO npm not found in PATH.
ECHO Please install Node.js from https://nodejs.org/
PAUSE
EXIT /B 1
:runElectron
IF NOT EXIST node_modules (
CALL :installModules
IF %errorlevel% NEQ 0 (
ECHO Failed to install node modules. Exiting.
PAUSE
EXIT /B 1
)
)
ECHO Node modules installed.
CALL :startElectron
EXIT /B %errorlevel%
:installModules
ECHO Installing node modules...
npm install && exit
IF %errorlevel% NEQ 0 (
ECHO Failed to install node modules. Check the error message above.
PAUSE
EXIT /B 1
)
EXIT /B 0
:startElectron
ECHO Starting Electron application...
npm run debug && exit
IF %errorlevel% NEQ 0 (
ECHO Failed to start Electron application. Check the error message above.
PAUSE
EXIT /B 1
)
EXIT /B 0