-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.cmd
More file actions
50 lines (44 loc) · 1.84 KB
/
Copy pathstart.cmd
File metadata and controls
50 lines (44 loc) · 1.84 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
@echo off
rem The one-step launcher for RēDesign.
cd /d "%~dp0"
rem Make sure the root has its clickable tray shortcut (a fresh clone won't).
rem Create-Shortcut.ps1 also deletes a stale "Reimagine.lnk" left over from before the rename.
rem The shortcut is really named "RēDesign.lnk" (ē = U+0113), but this .cmd is UTF-8 with no BOM,
rem so a literal "ē" here gets mangled in cmd.exe's OEM codepage and the test NEVER matches —
rem re-spawning PowerShell on every launch. The single-char "?" wildcard is ASCII-safe and
rem matches the macron exactly (verified), so the "already created?" skip actually works.
if not exist "R?Design.lnk" (
powershell -NoProfile -ExecutionPolicy Bypass -File "misc\Create-Shortcut.ps1" >nul 2>nul
)
set "PORT=5178"
if exist ".env" (
for /f "usebackq tokens=1,* delims==" %%A in (".env") do (
if /I "%%A"=="PORT" set "PORT=%%B"
)
)
where bun >nul 2>nul
if errorlevel 1 (
echo.
echo Bun was not found. Install Bun 1.1.0 or newer:
echo https://bun.sh
echo.
pause
exit /b 1
)
if not exist "src\web\dist\index.html" (
echo.
echo Building the web UI for the first time ^(this can take a minute^)...
call npm run build
)
echo.
echo Starting RēDesign...
echo Preferred port: %PORT% ^(hops to a free one if that's busy^)
echo.
echo Leave this window open while you use it. Press Ctrl+C here to stop.
echo.
rem The server may hop past %PORT% if something else holds it, so resolve the URL to open from
rem the runtime pointer it writes (~/.redesign/runtime.json), falling back to the preferred port.
rem Factored into misc\Open-Ui.ps1 (rather than an inline one-liner) so it can also honour
rem portableMode (opens a chromeless Edge/Chrome --app= window instead of a normal tab).
start "" /b powershell -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "misc\Open-Ui.ps1" -Port %PORT%
bun run src\index.ts serve