From 12b0cf8a020e3bc6395525aa5e3cf2cc9304630e Mon Sep 17 00:00:00 2001 From: Pranav Katariya Date: Wed, 28 Jan 2026 02:59:06 -0800 Subject: [PATCH] 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. --- git-hooks/pre-commit | 8 -------- scripts/format-staged.js | 23 +++-------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index 335739020..c2fe5149b 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -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" diff --git a/scripts/format-staged.js b/scripts/format-staged.js index 8f9d8b659..0ad2d7dd7 100644 --- a/scripts/format-staged.js +++ b/scripts/format-staged.js @@ -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", });