-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpostinstall.cjs
More file actions
29 lines (26 loc) · 975 Bytes
/
Copy pathpostinstall.cjs
File metadata and controls
29 lines (26 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const fs = require('fs');
const path = require('path');
function fixNodePtyPermissions() {
try {
const nodePtyIndex = require.resolve('node-pty');
const nodePtyDir = path.dirname(path.dirname(nodePtyIndex));
const prebuildsDir = path.join(nodePtyDir, 'prebuilds');
if (fs.existsSync(prebuildsDir)) {
const platforms = fs.readdirSync(prebuildsDir);
for (const platform of platforms) {
const helperPath = path.join(prebuildsDir, platform, 'spawn-helper');
if (fs.existsSync(helperPath)) {
const stat = fs.statSync(helperPath);
// If not executable
if ((stat.mode & 0o111) === 0) {
fs.chmodSync(helperPath, 0o755);
console.log(`[remote-claude] Fixed execution permissions for ${helperPath}`);
}
}
}
}
} catch (e) {
console.error("[remote-claude] Note: Could not fix node-pty permissions automatically.");
}
}
fixNodePtyPermissions();