Devtools: fix format-staged on Windows
This commit is contained in:
parent
f9c49a80bb
commit
ca6f8148b2
@ -61,6 +61,9 @@ function resolveOxfmtCommand(repoRoot) {
|
|||||||
const binName = process.platform === "win32" ? "oxfmt.cmd" : "oxfmt";
|
const binName = process.platform === "win32" ? "oxfmt.cmd" : "oxfmt";
|
||||||
const local = path.join(repoRoot, "node_modules", ".bin", binName);
|
const local = path.join(repoRoot, "node_modules", ".bin", binName);
|
||||||
if (fs.existsSync(local)) {
|
if (fs.existsSync(local)) {
|
||||||
|
if (process.platform === "win32" && local.toLowerCase().endsWith(".cmd")) {
|
||||||
|
return { command: "cmd.exe", args: ["/d", "/s", "/c", local] };
|
||||||
|
}
|
||||||
return { command: local, args: [] };
|
return { command: local, args: [] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user