refactor(device): 二进制改名 agent-device,默认读同目录 config.json

- 输出名 agent-device-<os>-<arch>,避免和仓库名/agent-core 在 ps 里混淆
- 不带 -config 时自动加载可执行文件同目录的 config.json(存在才读)
- 启动日志打印实际加载的配置文件路径
This commit is contained in:
2026-11-19 17:31:21 +08:00
parent 4333a53dd3
commit af2e4a1c20
3 changed files with 36 additions and 17 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ build_with_go() {
[ "$os" = windows ] && ext=.exe
echo "build $os/$arch"
GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -trimpath -ldflags "-s -w" \
-o "bin/agent-$os-$arch$ext" ./cmd/agent
-o "bin/agent-device-$os-$arch$ext" ./cmd/agent
done
}
@@ -35,7 +35,7 @@ elif command -v docker >/dev/null 2>&1; then
[ "$os" = windows ] && ext=.exe
echo "build $os/$arch"
GOOS=$os GOARCH=$arch go build -trimpath -ldflags "-s -w" \
-o "bin/agent-$os-$arch$ext" ./cmd/agent
-o "bin/agent-device-$os-$arch$ext" ./cmd/agent
done'
else
echo "需要 Go 或 docker 才能编译" >&2