mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
refactor: rename Tool.alpha to Tool.experimental
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const fs = require("node:fs");
|
||||
const { execFileSync } = require("node:child_process");
|
||||
const path = require("node:path");
|
||||
|
||||
const input = JSON.parse(fs.readFileSync("/dev/stdin", "utf8"));
|
||||
const filePath = input.tool_input?.file_path || "";
|
||||
const formattable = /\.(ts|tsx|js|jsx|json)$/;
|
||||
|
||||
if (filePath && formattable.test(filePath) && fs.existsSync(filePath)) {
|
||||
const projectRoot = path.resolve(__dirname, "..", "..");
|
||||
const biomeBin = path.join(projectRoot, "node_modules", ".bin", "biome");
|
||||
|
||||
try {
|
||||
execFileSync(biomeBin, ["check", "--write", filePath], {
|
||||
stdio: "pipe",
|
||||
cwd: projectRoot,
|
||||
});
|
||||
} catch {
|
||||
// Format failures are non-blocking
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user