Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(check): run pnpm checks on Windows (#1941)

林剑凛9a2cf6835c56
diff --git a/scripts/run-check.mjs b/scripts/run-check.mjs
index 25dab52236..888015ee37 100644
--- a/scripts/run-check.mjs
+++ b/scripts/run-check.mjs
@@ -1,5 +1,6 @@
import { spawn } from "node:child_process";
import { performance } from "node:perf_hooks";
+import { delimiter, join } from "node:path";
const tasks = [
{
@@ -26,9 +27,10 @@ const tasks = [
function runTask(task) {
const startedAt = performance.now();
- const child = spawn(task.command, task.args, {
+ const command = commandSpec(task);
+ const child = spawn(command.program, command.args, {
cwd: process.cwd(),
- env: process.env,
+ env: commandEnv(),
stdio: ["ignore", "pipe", "pipe"],
});
const stdout = [];
@@ -60,6 +62,19 @@ function runTask(task) {
});
}
+function commandSpec(task) {
+ if (process.platform !== "win32") return { program: task.command, args: task.args };
+ const command = join(process.cwd(), "node_modules", ".bin", `${task.command}.CMD`);
+ return { program: "cmd.exe", args: ["/d", "/c", "call", command, ...task.args] };
+}
+
+function commandEnv() {
+ return {
+ ...process.env,
+ PATH: [join(process.cwd(), "node_modules", ".bin"), process.env.PATH].filter(Boolean).join(delimiter),
+ };
+}
+
function outputFailureExcerpt(output) {
const lines = output.trimEnd().split(/\r?\n/);
const selected = new Set();