@akin01/mailgen 0.1.3 → 0.1.4

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/mailgen.js +6 -3
  2. package/package.json +1 -1
package/bin/mailgen.js CHANGED
@@ -5,11 +5,14 @@ const path = require('path');
5
5
  const os = require('os');
6
6
  const { spawnSync } = require('child_process');
7
7
 
8
- const binName = os.platform() === 'win32' ? 'emailgen.exe' : 'emailgen';
9
- const binPath = path.join(__dirname, binName);
8
+ const primaryBinName = os.platform() === 'win32' ? 'mailgen.exe' : 'mailgen';
9
+ const legacyBinName = os.platform() === 'win32' ? 'emailgen.exe' : 'emailgen';
10
+ const primaryBinPath = path.join(__dirname, primaryBinName);
11
+ const legacyBinPath = path.join(__dirname, legacyBinName);
12
+ const binPath = fs.existsSync(primaryBinPath) ? primaryBinPath : legacyBinPath;
10
13
 
11
14
  if (!fs.existsSync(binPath)) {
12
- console.error('emailgen binary not found. Please reinstall the package.');
15
+ console.error(`mailgen binary not found. Looked for ${primaryBinName} and ${legacyBinName}. Please reinstall the package.`);
13
16
  process.exit(1);
14
17
  }
15
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akin01/mailgen",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "High-performance email generator using Markov chains and Bloom filters",
5
5
  "main": "index.js",
6
6
  "bin": {