fix(ui): localize workspace file rail labels · openclaw/openclaw@e4313ba
vincentkoc
·
2026-06-14
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1168,14 +1168,17 @@ export async function runProcess(
|
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | async function formatGeneratedTypeScript(filePath: string, source: string): Promise<string> { |
1171 | | -const result = await runProcess( |
1172 | | -"pnpm", |
1173 | | -["exec", "oxfmt", "--stdin-filepath", path.relative(ROOT, filePath)], |
1174 | | -{ |
1175 | | -input: source, |
1176 | | -rejectOnFailure: true, |
1177 | | -}, |
1178 | | -); |
| 1171 | +const directFormatterPath = path.join(ROOT, "node_modules", ".bin", "oxfmt"); |
| 1172 | +const formatterCommand = |
| 1173 | +process.platform !== "win32" && existsSync(directFormatterPath) ? directFormatterPath : "pnpm"; |
| 1174 | +const formatterArgs = |
| 1175 | +formatterCommand === directFormatterPath |
| 1176 | + ? ["--stdin-filepath", path.relative(ROOT, filePath)] |
| 1177 | + : ["exec", "oxfmt", "--stdin-filepath", path.relative(ROOT, filePath)]; |
| 1178 | +const result = await runProcess(formatterCommand, formatterArgs, { |
| 1179 | +input: source, |
| 1180 | +rejectOnFailure: true, |
| 1181 | +}); |
1179 | 1182 | return restoreReplacementCorruptedStringLiterals(source, result.stdout); |
1180 | 1183 | } |
1181 | 1184 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。