revert: remove unrelated infrastructure changes

Remove changes to git-hooks/pre-commit and scripts/format-staged.js that were
accidentally copied from clawdbot repo. These are unrelated to the Zoom plugin
and should not be in this PR.

Restored both files to match main branch.
This commit is contained in:
Pranav Katariya 2026-01-28 02:59:06 -08:00
parent 9646db8410
commit 12b0cf8a02
2 changed files with 3 additions and 28 deletions

View File

@ -1,12 +1,4 @@
#!/bin/sh
ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
[ -z "$ROOT" ] && exit 0
# Use Node 22 via nvm if available
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
. "$NVM_DIR/nvm.sh"
nvm use 22 > /dev/null 2>&1 || true
fi
node "$ROOT/scripts/format-staged.js"

View File

@ -58,27 +58,14 @@ function filterOutPartialTargets(targets, partialTargets) {
}
function resolveOxfmtCommand(repoRoot) {
// Run oxfmt via node to avoid Node.js ESM issues with extensionless binaries
const cliPath = path.join(repoRoot, "node_modules", "oxfmt", "dist", "cli.js");
if (fs.existsSync(cliPath)) {
return { command: "node", args: [cliPath] };
}
// Fallback to pnpm
const pnpmResult = spawnSync("pnpm", ["--version"], { stdio: "ignore", cwd: repoRoot });
if (pnpmResult.status === 0) {
return { command: "pnpm", args: ["oxfmt"] };
}
// Fallback to direct oxfmt if available
const binName = process.platform === "win32" ? "oxfmt.cmd" : "oxfmt";
const local = path.join(repoRoot, "node_modules", ".bin", binName);
if (fs.existsSync(local)) {
return { command: local, args: [] };
}
const globalResult = spawnSync("oxfmt", ["--version"], { stdio: "ignore" });
if (globalResult.status === 0) {
const result = spawnSync("oxfmt", ["--version"], { stdio: "ignore" });
if (result.status === 0) {
return { command: "oxfmt", args: [] };
}
@ -92,11 +79,7 @@ function getGitPaths(args, repoRoot) {
}
function formatFiles(repoRoot, oxfmt, files) {
const args =
oxfmt.command === "pnpm" ? [...oxfmt.args, "--write", ...files]
: oxfmt.command === "node" ? [...oxfmt.args, "--write", ...files]
: ["--write", ...oxfmt.args, ...files];
const result = spawnSync(oxfmt.command, args, {
const result = spawnSync(oxfmt.command, ["--write", ...oxfmt.args, ...files], {
cwd: repoRoot,
stdio: "inherit",
});