Download scripts/pre-commit.js from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 494 Bytes
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/scripts/pre-commit.js
- Command line
-
hf download hf://SaylorTwift/gemini-cli/scripts/pre-commit.js
-
curl -L -o pre-commit.js https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/scripts/pre-commit.js
494 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { execSync } from 'node:child_process'; | |
| import lintStaged from 'lint-staged'; | |
| try { | |
| // Get repository root | |
| const root = execSync('git rev-parse --show-toplevel').toString().trim(); | |
| // Run lint-staged with API directly | |
| const passed = await lintStaged({ cwd: root }); | |
| // Exit with appropriate code | |
| process.exit(passed ? 0 : 1); | |
| } catch { | |
| // Exit with error code | |
| process.exit(1); | |
| } | |