fix: 修复 Windows trans 编码与参数传递

This commit is contained in:
Codex
2026-07-10 13:31:26 +02:00
parent ad93490f4a
commit b6ac6f71f6
6 changed files with 108 additions and 4 deletions
+18
View File
@@ -768,6 +768,24 @@ async function main(): Promise<void> {
return;
}
if (top === "trans" || top === "tran") {
const error = new Error(`${top} is a PATH wrapper, not a bun scripts/cli.ts subcommand`);
Object.assign(error, {
name: "TransEntrypointMigrationError",
code: "trans-root-cli-entrypoint-moved",
level: "error",
entrypoint: top,
operation: "root-cli-dispatch",
replacementExamples: {
canonical: `trans ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
legacyUnified: `bun scripts/cli.ts ssh ${sub ?? "<route>"} ${args.slice(2).join(" ") || "<operation>"}`,
},
migrationHint: "Use: trans <route> <operation> [args...]. The PATH wrapper delegates to the lightweight SSH CLI.",
note: "Ordinary root CLI commands continue to use bun scripts/cli.ts <command>.",
});
throw error;
}
throw new Error(`Unknown command: ${commandName}`);
}