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
2 changes: 1 addition & 1 deletion bds-tools/src/check-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { compareVersions, getCurrentVersionAsync, getCurrentVersionSync, saveVer

// 独立入口:source = "updater",与 bds-manager 的 "bds-tools" 区分
const updaterFileSink = createFileSink(LOG_PATH);
export const log = createLogger({ source: "updater", sinks: [createStdoutSink({ bare: true }), updaterFileSink] });
const log = createLogger({ source: "updater", sinks: [createStdoutSink({ bare: true }), updaterFileSink] });
const closeLog = (): void => updaterFileSink.close();

function parseArgs(argv: string[]): Record<string, string | boolean> {
Expand Down
2 changes: 1 addition & 1 deletion bds-tools/src/qqutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
type QQBridgeConfig,
} from "@sfmc-bds/sdk/node/config";
import http from "node:http";
import { log } from "./check-update.js";
import { log } from "./log.js";
import { ROOT_DIR } from "./paths.js";

type QqConfig = Pick<QQBridgeConfig, "llbot_http" | "qq_group_id">;
Expand Down
5 changes: 4 additions & 1 deletion db-server/src/domain/economy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ import { sql } from "../lib/sql-helpers.js";
import type { TxResult } from "./transaction.js";
export type { TxResult };

/** 账户表行(与 feature-economy 权威类型结构对齐) */
/**
* 经济域行模型(原 SDK contracts/economy;契约内聚到表所有者 db-server)。
* 业务模块应通过 service(economy.*) 消费视图,不依赖这些内部行类型。
*/
export interface EconomyAccountRow {
player_id: string;
player_name_snapshot: string;
Expand Down
19 changes: 12 additions & 7 deletions sfmc/src/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ function terminalSettingsFiles(): string[] {
.filter((file) => fs.existsSync(file));
}

function preferredPowerShell(): string {
/** Windows Terminal profile.commandline:启动 shell 并立即进入 sfmc */
function preferredSfmcCommandline(): string {
const programFiles = [process.env.ProgramW6432, process.env.ProgramFiles].filter((value): value is string =>
Boolean(value)
);
Expand All @@ -66,14 +67,18 @@ function preferredPowerShell(): string {
];

const installed = candidates.find((candidate) => fs.existsSync(candidate));
if (installed) return "pwsh -Command sfmc";
if (installed) return `"${installed}" -Command sfmc`;
if (spawnSync("pwsh.exe", ["-NoProfile", "-Command", "exit"], { stdio: "ignore", windowsHide: true }).status === 0) {
return "pwsh -Command sfmc";
return "pwsh.exe -Command sfmc";
}
return (
path.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe") +
" -Command sfmc"
const windowsPowerShell = path.join(
process.env.SystemRoot ?? "C:\\Windows",
"System32",
"WindowsPowerShell",
"v1.0",
"powershell.exe"
);
return `"${windowsPowerShell}" -Command sfmc`;
}

function newGuid(): string {
Expand Down Expand Up @@ -203,5 +208,5 @@ export function ensureSeaTerminalProfile(): void {

const runtimeFile = configPath(ROOT, "runtime.json");
const state = terminalState(runtimeFile, path.dirname(process.execPath));
for (const settingsFile of settingsFiles) updateProfile(settingsFile, state, preferredPowerShell());
for (const settingsFile of settingsFiles) updateProfile(settingsFile, state, preferredSfmcCommandline());
}
Loading