@greenarmor/ges-git-hooks 1.5.1 → 1.5.2

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
  import { runAudit, deduplicateFindings } from "@greenarmor/ges-audit-engine";
4
+ import { safeWriteFile } from "@greenarmor/ges-core";
4
5
  export const PRE_COMMIT_HOOK = `#!/bin/sh
5
6
  # GESF Pre-Commit Hook - Runs compliance audit before allowing commits
6
7
  # Installed by @greenarmor/ges-git-hooks
@@ -61,7 +62,7 @@ export function installHooks(projectRoot, hooks = ["pre-commit"]) {
61
62
  if (fs.existsSync(hookPath)) {
62
63
  const existing = fs.readFileSync(hookPath, "utf-8");
63
64
  if (existing.includes("@greenarmor/ges-git-hooks")) {
64
- fs.writeFileSync(hookPath, hookContents[hookName], "utf-8");
65
+ safeWriteFile(hookPath, hookContents[hookName]);
65
66
  fs.chmodSync(hookPath, 0o755);
66
67
  result.installed.push(hookName);
67
68
  continue;
@@ -69,7 +70,7 @@ export function installHooks(projectRoot, hooks = ["pre-commit"]) {
69
70
  result.skipped.push(`${hookName} (already exists, not a GESF hook)`);
70
71
  continue;
71
72
  }
72
- fs.writeFileSync(hookPath, hookContents[hookName], "utf-8");
73
+ safeWriteFile(hookPath, hookContents[hookName]);
73
74
  fs.chmodSync(hookPath, 0o755);
74
75
  result.installed.push(hookName);
75
76
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@greenarmor/ges-audit-engine": "1.5.1",
4
- "@greenarmor/ges-core": "1.5.1"
3
+ "@greenarmor/ges-audit-engine": "1.5.2",
4
+ "@greenarmor/ges-core": "1.5.2"
5
5
  },
6
6
  "description": "GESF Git Hooks - Pre-commit compliance enforcement",
7
7
  "devDependencies": {
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "type": "module",
40
40
  "types": "./dist/index.d.ts",
41
- "version": "1.5.1",
41
+ "version": "1.5.2",
42
42
  "scripts": {
43
43
  "build": "tsc",
44
44
  "clean": "rm -rf dist tsconfig.tsbuildinfo",