Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/resolve-bds-path-from-root.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sfmc-bds/cli": patch
---

将 BDS 启动目录相对 SFMC_ROOT 解析,并在非 Windows 主机上明确拒绝 Windows 绝对路径配置。
11 changes: 9 additions & 2 deletions packages/cli/src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,14 @@ function createServices(): Record<ServiceName, Service> {
string,
unknown
>) as DBConfig;
const bdsPath = bdsCfg.bds_path ?? ROOT;
const rawBdsPath = String(bdsCfg.bds_path ?? "").trim();
if (process.platform !== "win32" && /^[A-Za-z]:[\\/]/.test(rawBdsPath)) {
throw new Error(
`configs/bds_updater.json 的 bds_path 是 Windows 路径(${rawBdsPath})。` +
`请改成相对 SFMC_ROOT 的路径,例如 "BDS"。`
);
}
const bdsPath = path.resolve(ROOT, rawBdsPath || ".");
const useLlbotBackend = qqCfg.qq_backend === "llbot";
const qqEnabled = qqCfg.qq_enabled !== false;
// 官方 Webhook 由云端接收;仅切换传输方式即可避免本机再启动一个桥。
Expand All @@ -463,7 +470,7 @@ function createServices(): Record<ServiceName, Service> {
const dbPort = dbCfg.db_port ?? 3001;
dbHealthPort = dbPort;
qqBackendMode = useLlbotBackend ? "llbot" : "official";
const bdsExe = bdsExePath(path.resolve(bdsPath));
const bdsExe = bdsExePath(bdsPath);
const qqTitle = useLlbotBackend ? "QQ (llbot)" : "QQ (official)";

return {
Expand Down
Loading