-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
41 lines (34 loc) · 2.14 KB
/
Copy pathstart.bat
File metadata and controls
41 lines (34 loc) · 2.14 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
@echo off
title Android Media Copier
cd /d "%~dp0"
REM ── Locate Node.js ──────────────────────────────────────────────────────────
where node >nul 2>&1
if %errorlevel% equ 0 goto :node_ok
if exist "%ProgramFiles%\nodejs\node.exe" set "PATH=%ProgramFiles%\nodejs;%PATH%" & goto :node_ok
if exist "%ProgramFiles(x86)%\nodejs\node.exe" set "PATH=%ProgramFiles(x86)%\nodejs;%PATH%" & goto :node_ok
if exist "%LOCALAPPDATA%\Programs\nodejs\node.exe" set "PATH=%LOCALAPPDATA%\Programs\nodejs;%PATH%" & goto :node_ok
echo Node.js was not found on this computer.
echo Please install it from https://nodejs.org and try again.
pause
exit /b 1
:node_ok
REM ── Dependencies ────────────────────────────────────────────────────────────
if not exist "node_modules" (
echo Installing dependencies...
call npm install
if errorlevel 1 ( echo Install failed. & pause & exit /b 1 )
)
REM ── Build ───────────────────────────────────────────────────────────────────
if not exist "dist\server.js" (
echo Building...
call npm run build
if errorlevel 1 ( echo Build failed. & pause & exit /b 1 )
)
REM ── ADB ─────────────────────────────────────────────────────────────────────
if not exist "bin\win\adb.exe" (
echo Downloading ADB tools ^(one-time setup, requires internet^)...
call node scripts\setup.js --current
if errorlevel 1 ( echo ADB setup failed. & pause & exit /b 1 )
)
REM ── Launch ──────────────────────────────────────────────────────────────────
node dist\server.js