-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
67 lines (58 loc) · 2.05 KB
/
Copy pathinstall.bat
File metadata and controls
67 lines (58 loc) · 2.05 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
@echo off
setlocal EnableDelayedExpansion
title Meshy GLB Exporter - Build ^& Install
set "ROOT=%~dp0"
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
cd /d "%ROOT%"
echo.
echo ============================================
echo Meshy GLB Exporter - build ^& install
echo ============================================
echo.
:: ---- Node.js (required) ----
where node >nul 2>&1
if errorlevel 1 (
echo ERROR: Node.js was not found.
echo Install Node 18+ from https://nodejs.org/ then run this again.
echo Opening the download page now...
echo.
start "" "https://nodejs.org/en/download/prebuilt-installer"
pause & exit /b 1
)
for /f "tokens=*" %%v in ('node --version') do echo Node %%v found.
:: ---- npm (ships with Node, but check anyway) ----
where npm >nul 2>&1
if errorlevel 1 (
echo ERROR: npm was not found. Reinstall Node.js from https://nodejs.org/ then run this again.
echo.
pause & exit /b 1
)
echo.
echo [1/2] Installing dependencies (npm install)...
call npm install
if errorlevel 1 ( echo ERROR: npm install failed. & pause & exit /b 1 )
echo.
echo [2/2] Building the extension (npm run build)...
call npm run build
if errorlevel 1 ( echo ERROR: build failed. & pause & exit /b 1 )
:: Copy the dist path so it can be pasted into Chrome's folder picker.
<nul set /p "=%ROOT%\dist" | clip
echo.
echo Opening Chrome's extensions page and this folder...
start "" chrome "chrome://extensions/"
start "" "%ROOT%"
echo.
echo ============================================
echo Almost done - in Chrome:
echo ============================================
echo 1. Turn on "Developer mode" (top-right switch).
echo 2. Click "Load unpacked" (top-left).
echo 3. Choose the "dist" folder (this folder just opened;
echo its path is on your clipboard - paste it and press Enter).
echo 4. Open a model on meshy.ai and click the blue GLB button.
echo.
echo If Chrome did not open, paste this in its address bar: chrome://extensions
echo Rebuilt later? Run this again, then click reload on the extension's card.
echo.
endlocal
pause