hookreplay 1.0.4 → 1.0.6

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.
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "hookreplay",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Debug webhooks locally - capture, inspect, and replay webhooks to your local server",
5
+ "files": [
6
+ "bin/",
7
+ "scripts/",
8
+ "README.md"
9
+ ],
5
10
  "keywords": [
6
11
  "webhook",
7
12
  "debugging",
@@ -25,7 +25,7 @@ function getPlatformKey() {
25
25
  }
26
26
 
27
27
  function getBinaryName() {
28
- return process.platform === 'win32' ? 'hookreplay.exe' : 'hookreplay';
28
+ return process.platform === 'win32' ? 'hookreplay-bin.exe' : 'hookreplay-bin';
29
29
  }
30
30
 
31
31
  function getDownloadUrl(platformKey) {
@@ -94,6 +94,11 @@ async function install() {
94
94
  const AdmZip = require('adm-zip');
95
95
  const zip = new AdmZip(buffer);
96
96
  zip.extractAllTo(binDir, true);
97
+ // Rename extracted file to hookreplay-bin.exe
98
+ const extractedPath = path.join(binDir, 'hookreplay.exe');
99
+ if (fs.existsSync(extractedPath)) {
100
+ fs.renameSync(extractedPath, path.join(binDir, binaryName));
101
+ }
97
102
  } else {
98
103
  // For tar.gz files
99
104
  const gunzip = zlib.gunzipSync(buffer);
@@ -109,7 +114,7 @@ async function install() {
109
114
 
110
115
  if (fileName && fileSize > 0) {
111
116
  const content = gunzip.slice(offset + 512, offset + 512 + fileSize);
112
- const destPath = path.join(binDir, path.basename(fileName));
117
+ const destPath = path.join(binDir, binaryName);
113
118
  fs.writeFileSync(destPath, content);
114
119
 
115
120
  // Make executable on Unix