mehen 0.4.2 → 0.4.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/mehen.js +23 -3
  2. package/package.json +9 -9
package/bin/mehen.js CHANGED
@@ -26,7 +26,7 @@ function detectMusl() {
26
26
  }
27
27
 
28
28
  return false;
29
- } catch (error) {
29
+ } catch {
30
30
  return false;
31
31
  }
32
32
  }
@@ -83,7 +83,7 @@ function main() {
83
83
  let binPath;
84
84
  try {
85
85
  binPath = require.resolve(`${pkgName}/bin/${binName}`);
86
- } catch (resolveError) {
86
+ } catch {
87
87
  console.error(`Error: Could not find mehen binary for your platform (${pkgName}).`);
88
88
  console.error('');
89
89
  console.error('This usually means:');
@@ -119,9 +119,29 @@ function main() {
119
119
  windowsHide: false
120
120
  });
121
121
  } catch (execError) {
122
- if (execError.status !== undefined) {
122
+ if (typeof execError.status === 'number') {
123
123
  process.exit(execError.status);
124
124
  }
125
+ if (execError.code === 'EACCES') {
126
+ if (process.platform === 'win32') {
127
+ console.error(`Error: access denied when launching mehen binary at ${binPath}.`);
128
+ console.error('On Windows this usually means the file is locked by another process');
129
+ console.error('(e.g. antivirus scan) or was quarantined. Try rerunning the command,');
130
+ console.error('and if it persists, reinstall mehen or whitelist the binary.');
131
+ } else {
132
+ console.error(`Error: mehen binary at ${binPath} is not executable.`);
133
+ console.error('This is likely a packaging bug — please report it at:');
134
+ console.error(' https://github.com/ophidiarium/mehen/issues');
135
+ console.error('');
136
+ console.error(`Workaround: chmod +x "${binPath}"`);
137
+ }
138
+ process.exit(126);
139
+ }
140
+ if (execError.code === 'ENOENT') {
141
+ console.error(`Error: mehen binary not found at ${binPath}.`);
142
+ console.error('Try reinstalling mehen.');
143
+ process.exit(127);
144
+ }
125
145
  console.error(`Error executing mehen binary: ${execError.message}`);
126
146
  process.exit(1);
127
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mehen",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Tool to compute and export code metrics",
5
5
  "keywords": [
6
6
  "metrics",
@@ -37,14 +37,14 @@
37
37
  "node": ">=18.0.0"
38
38
  },
39
39
  "optionalDependencies": {
40
- "@mehen/linux-x64-gnu": "0.4.2",
41
- "@mehen/linux-x64-musl": "0.4.2",
42
- "@mehen/linux-arm64-gnu": "0.4.2",
43
- "@mehen/linux-arm64-musl": "0.4.2",
44
- "@mehen/darwin-x64": "0.4.2",
45
- "@mehen/darwin-arm64": "0.4.2",
46
- "@mehen/win32-x64": "0.4.2",
47
- "@mehen/win32-arm64": "0.4.2"
40
+ "@mehen/linux-x64-gnu": "0.4.3",
41
+ "@mehen/linux-x64-musl": "0.4.3",
42
+ "@mehen/linux-arm64-gnu": "0.4.3",
43
+ "@mehen/linux-arm64-musl": "0.4.3",
44
+ "@mehen/darwin-x64": "0.4.3",
45
+ "@mehen/darwin-arm64": "0.4.3",
46
+ "@mehen/win32-x64": "0.4.3",
47
+ "@mehen/win32-arm64": "0.4.3"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"