mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-13 22:29:48 +08:00
build: commit vendored shared skill packages
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { spawnSync } from "node:child_process";
|
||||
import path from "node:path";
|
||||
|
||||
async function main() {
|
||||
const repoRoot = path.resolve(process.cwd());
|
||||
const hooksPath = path.join(repoRoot, ".githooks");
|
||||
|
||||
const result = spawnSync("git", ["config", "core.hooksPath", hooksPath], {
|
||||
cwd: repoRoot,
|
||||
stdio: "inherit",
|
||||
});
|
||||
|
||||
if (result.status !== 0) {
|
||||
throw new Error("Failed to configure core.hooksPath");
|
||||
}
|
||||
|
||||
console.log(`Configured git hooks path: ${hooksPath}`);
|
||||
}
|
||||
|
||||
main().catch((error) => {
|
||||
console.error(error instanceof Error ? error.message : String(error));
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user