-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
61 lines (53 loc) · 1.46 KB
/
build.bat
File metadata and controls
61 lines (53 loc) · 1.46 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
@echo off
REM Build and run Moon application
REM This script loads environment variables from .env file and starts the server
echo Building Moon application...
go build -o moon.exe
if %ERRORLEVEL% NEQ 0 (
echo Build failed!
pause
exit /b 1
)
echo Build successful!
echo.
REM Check if .env file exists
if not exist .env (
echo WARNING: .env file not found!
echo Please copy .env.example to .env and add your Google Maps API key.
echo.
echo Creating .env from .env.example...
copy .env.example .env
echo.
echo Please edit .env and add your GOOGLE_MAPS_API_KEY, then run this script again.
pause
exit /b 1
)
echo Loading environment variables from .env...
for /f "usebackq tokens=1,* delims==" %%a in (.env) do (
REM Skip comments and empty lines
echo %%a | findstr /r "^#" >nul
if errorlevel 1 (
if not "%%a"=="" (
set "%%a=%%b"
)
)
)
REM Check if API key is set
if "%GOOGLE_MAPS_API_KEY%"=="" (
echo ERROR: GOOGLE_MAPS_API_KEY is not set in .env file!
echo Please edit .env and add your Google Maps API key.
pause
exit /b 1
)
if "%GOOGLE_MAPS_API_KEY%"=="your_google_maps_api_key_here" (
echo ERROR: Please replace the placeholder API key in .env with your actual key!
pause
exit /b 1
)
echo API Key loaded: %GOOGLE_MAPS_API_KEY:~0,10%...
echo Production mode: %PROD%
echo.
echo Starting server on http://localhost:8484
echo Press Ctrl+C to stop the server
echo.
moon.exe