Files
gotail/build.bat
T
Luiz Costa ac4f232e5e build: update npm install command to use --legacy-peer-deps
This change modifies the build scripts to use --legacy-peer-deps flag when installing npm dependencies to resolve potential peer dependency conflicts during the build process. The change is applied to both bash (build.sh) and batch (build.bat) build scripts.
2025-11-18 10:23:55 -03:00

42 lines
1.2 KiB
Batchfile

@echo off
echo 🚀 Iniciando o processo de build...
REM Passo 1: Build do Frontend (React)
echo 📦 Instalando dependências do frontend...
cd frontend
call npm install --legacy-peer-deps
echo 🔨 Construindo o frontend para produção...
call npm run build
if %errorlevel% neq 0 (
echo ❌ Falha no build do frontend. Abortando.
exit /b %errorlevel%
)
cd ..
REM Passo 2: Build do Backend (Go)
echo 🔨 Compilando o backend com arquivos embedados...
echo 📁 Copiando artefatos do frontend para backend/dist...
if exist backend\dist rmdir /s /q backend\dist
mkdir backend\dist
xcopy /E /I /Y frontend\dist\* backend\dist\
cd backend
go mod tidy
go build -o ../web-tail-pro.exe ./main.go
cd ..
if %errorlevel% neq 0 (
echo ❌ Falha na compilação do backend. Abortando.
exit /b %errorlevel%
)
echo ✅ Build concluído com sucesso!
echo ➡️ Execute o binário gerado:
echo .\web-tail-pro.exe [opções] backend\logs\app.log backend\logs\access.log backend\logs\json.log
echo.
echo Exemplos:
echo .\web-tail-pro.exe -port :9090 -password s3nh4 backend\logs\*.log
echo .\web-tail-pro.exe -password s3nh4 backend\logs\app.log
echo .\web-tail-pro.exe -port 1234 backend\logs\*.log