infernoflow 0.10.7 → 0.10.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,36 @@
1
- #!/usr/bin/env node
2
- import * as fs from "node:fs";
3
- import * as path from "node:path";
4
-
5
- const cwd = process.cwd();
6
- const gitDir = path.join(cwd, ".git");
7
- const hooksDir = path.join(gitDir, "hooks");
8
-
9
- if (!fs.existsSync(gitDir)) {
10
- console.error("[inferno hooks] .git not found. Run inside a git repository.");
11
- process.exit(1);
12
- }
13
-
14
- fs.mkdirSync(hooksDir, { recursive: true });
15
-
16
- const preCommit = `#!/bin/sh
17
- echo "[inferno hooks] pre-commit: infernoflow check --skip-doc-gate"
18
- npx infernoflow check --skip-doc-gate
19
- `;
20
-
21
- const prePush = `#!/bin/sh
22
- echo "[inferno hooks] pre-push: infernoflow doc-gate"
23
- npx infernoflow doc-gate
24
- `;
25
-
26
- const writeHook = (name, content) => {
27
- const filePath = path.join(hooksDir, name);
28
- fs.writeFileSync(filePath, content, "utf8");
29
- fs.chmodSync(filePath, 0o755);
30
- console.log(`[inferno hooks] installed ${name}`);
31
- };
32
-
33
- writeHook("pre-commit", preCommit);
34
- writeHook("pre-push", prePush);
35
- console.log("[inferno hooks] done");
36
-
1
+ #!/usr/bin/env node
2
+ import * as fs from "node:fs";
3
+ import * as path from "node:path";
4
+
5
+ const cwd = process.cwd();
6
+ const gitDir = path.join(cwd, ".git");
7
+ const hooksDir = path.join(gitDir, "hooks");
8
+
9
+ if (!fs.existsSync(gitDir)) {
10
+ console.error("[inferno hooks] .git not found. Run inside a git repository.");
11
+ process.exit(1);
12
+ }
13
+
14
+ fs.mkdirSync(hooksDir, { recursive: true });
15
+
16
+ const preCommit = `#!/bin/sh
17
+ echo "[inferno hooks] pre-commit: infernoflow run --dry-run"
18
+ npx infernoflow run "sync check" --dry-run
19
+ `;
20
+
21
+ const prePush = `#!/bin/sh
22
+ echo "[inferno hooks] pre-push: infernoflow run --json"
23
+ npx infernoflow run "sync check" --json
24
+ `;
25
+
26
+ const writeHook = (name, content) => {
27
+ const filePath = path.join(hooksDir, name);
28
+ fs.writeFileSync(filePath, content, "utf8");
29
+ fs.chmodSync(filePath, 0o755);
30
+ console.log(`[inferno hooks] installed ${name}`);
31
+ };
32
+
33
+ writeHook("pre-commit", preCommit);
34
+ writeHook("pre-push", prePush);
35
+ console.log("[inferno hooks] done");
36
+