talk-to-copilot 1.0.0 → 1.0.1
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 +1 -1
- package/scripts/postinstall.js +9 -4
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -10,13 +10,18 @@ const os = require('os');
|
|
|
10
10
|
|
|
11
11
|
if (os.platform() !== 'darwin' && os.platform() !== 'linux') process.exit(0);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// Use require.resolve to find node-pty regardless of hoisting / install location
|
|
14
|
+
let nodePtyDir;
|
|
15
|
+
try {
|
|
16
|
+
nodePtyDir = path.dirname(require.resolve('node-pty/package.json'));
|
|
17
|
+
} catch {
|
|
18
|
+
process.exit(0); // node-pty not found, nothing to fix
|
|
19
|
+
}
|
|
15
20
|
|
|
16
21
|
const platform = `${os.platform()}-${os.arch()}`;
|
|
17
22
|
const targets = [
|
|
18
|
-
path.join(
|
|
19
|
-
path.join(
|
|
23
|
+
path.join(nodePtyDir, 'prebuilds', platform, 'spawn-helper'),
|
|
24
|
+
path.join(nodePtyDir, 'prebuilds', platform, 'pty.node'),
|
|
20
25
|
];
|
|
21
26
|
|
|
22
27
|
let fixed = 0;
|