mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-13 06:19:46 +08:00
11 lines
352 B
TypeScript
11 lines
352 B
TypeScript
import { spawnSync } from "node:child_process";
|
|
import process from "node:process";
|
|
|
|
export function applyAutocorrect(filePath: string): boolean {
|
|
const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
const result = spawnSync(npxCmd, ["autocorrect-node", "--fix", filePath], {
|
|
stdio: "inherit",
|
|
});
|
|
return result.status === 0;
|
|
}
|