hunkdiff 0.3.0-beta.1 → 0.3.0-beta.3

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/bin/hunk.cjs +17 -0
  2. package/package.json +4 -4
package/bin/hunk.cjs CHANGED
@@ -5,7 +5,24 @@ const fs = require("node:fs");
5
5
  const os = require("node:os");
6
6
  const path = require("node:path");
7
7
 
8
+ function ensureExecutable(target) {
9
+ if (process.platform === "win32") {
10
+ return;
11
+ }
12
+
13
+ try {
14
+ const mode = fs.statSync(target).mode & 0o777;
15
+ if ((mode & 0o111) !== 0) {
16
+ return;
17
+ }
18
+ fs.chmodSync(target, mode | 0o755);
19
+ } catch {
20
+ // Let spawnSync surface the real error if chmod is not possible.
21
+ }
22
+ }
23
+
8
24
  function run(target, args) {
25
+ ensureExecutable(target);
9
26
  const result = childProcess.spawnSync(target, args, {
10
27
  stdio: "inherit",
11
28
  env: process.env,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hunkdiff",
3
- "version": "0.3.0-beta.1",
3
+ "version": "0.3.0-beta.3",
4
4
  "description": "Desktop-inspired terminal diff viewer for understanding agent-authored changesets.",
5
5
  "bin": {
6
6
  "hunk": "./bin/hunk.cjs"
@@ -30,9 +30,9 @@
30
30
  "node": ">=18"
31
31
  },
32
32
  "optionalDependencies": {
33
- "hunkdiff-darwin-arm64": "0.3.0-beta.1",
34
- "hunkdiff-darwin-x64": "0.3.0-beta.1",
35
- "hunkdiff-linux-x64": "0.3.0-beta.1"
33
+ "hunkdiff-darwin-arm64": "0.3.0-beta.3",
34
+ "hunkdiff-darwin-x64": "0.3.0-beta.3",
35
+ "hunkdiff-linux-x64": "0.3.0-beta.3"
36
36
  },
37
37
  "license": "MIT",
38
38
  "publishConfig": {