fix: build the server through the package, not one file

The CLI now lives in two files (main.go and update_cli.go), so
`go build cmd/server/main.go` compiles only main.go and leaves
updateCommandIfNeeded undefined - which is exactly how run.sh (twice) and both
READMEs built. `go build ./cmd/server` compiles the whole package; run.sh's
rebuild check already scans internal/ and cmd/ for newer sources, so nothing
else needed adjusting.
This commit is contained in:
Sycun committed 2026-10-07 12:11:50 +08:00
1 parent c0f2e25ed1
commit dc5c4d6a75
3 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -256,10 +256,10 @@ The `run.sh` script will automatically:
**Alternative Launch Methods:**
```bash
# Direct Go run (set up env yourself); add --https to match run.sh defaults
go run cmd/server/main.go --https
go run ./cmd/server --https
# Manual build
go build -o cyberstrike-ai cmd/server/main.go
go build -o cyberstrike-ai ./cmd/server
./cyberstrike-ai --https
```
+2 -2
View File
@@ -255,10 +255,10 @@ chmod +x run.sh && ./run.sh
**其他启动方式:**
```bash
# 直接运行(需自行配环境);与 run.sh 默认一致可加 --https
go run cmd/server/main.go --https
go run ./cmd/server --https
# 手动编译
go build -o cyberstrike-ai cmd/server/main.go
go build -o cyberstrike-ai ./cmd/server
./cyberstrike-ai --https
```
+1 -1
View File
@@ -313,7 +313,7 @@ build_go_project() {
(
set +e # disable errexit in subshell
export GOPROXY="$GOPROXY"
go build -o "$BINARY_NAME" cmd/server/main.go >"$GO_BUILD_LOG" 2>&1
go build -o "$BINARY_NAME" ./cmd/server >"$GO_BUILD_LOG" 2>&1
echo $? > "${GO_BUILD_LOG}.exit"
) &
GO_BUILD_PID=$!