-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
52 lines (47 loc) · 1.31 KB
/
build.bat
File metadata and controls
52 lines (47 loc) · 1.31 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
@echo off
chcp 65001 >nul
echo ========================================
echo 静态目录服务器 - 构建脚本
echo ========================================
echo.
REM 首先尝试使用 wails build
where wails >nul 2>&1
if %errorlevel% equ 0 (
echo [信息] 使用 wails build 构建(推荐)...
echo.
wails build
if %errorlevel% equ 0 (
echo.
echo ========================================
echo 构建成功!
echo ========================================
echo 可执行文件位置: build\bin\static-server.exe
echo.
pause
exit /b 0
)
)
echo [信息] wails 命令不可用,使用 go build -tags dev 构建...
echo.
go build -tags dev -ldflags -H=windowsgui -o static-server.exe main.go
if %errorlevel% equ 0 (
echo.
echo ========================================
echo 构建成功!
echo ========================================
echo 可执行文件: static-server.exe
echo.
echo 注意:这是开发模式构建
echo 建议安装 wails CLI 并使用 wails build 进行完整构建
echo.
) else (
echo.
echo ========================================
echo 构建失败!
echo ========================================
echo 请检查错误信息
echo.
pause
exit /b 1
)
pause