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:
parent
c0f2e25ed1
commit
dc5c4d6a75
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
2
run.sh
2
run.sh
|
|
@ -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=$!
|
||||
|
|
|
|||
Loading…
Reference in New Issue