claude-all-config 3.5.8 → 3.5.9

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 (3) hide show
  1. package/VERSION +1 -1
  2. package/package.json +1 -1
  3. package/postinstall.js +64 -19
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.5.8
1
+ 3.5.9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-all-config",
3
- "version": "3.5.8",
3
+ "version": "3.5.9",
4
4
  "description": "🦾 MONSTER ENGINEER v2 - Ultimate AI CLI with 63 Skills, 12 Superpowers, 14 Agents. Multi-Agent Orchestration, Cost-Aware, Security Scorecard, Parallel-First.",
5
5
  "main": "index.js",
6
6
  "bin": {
package/postinstall.js CHANGED
@@ -33,32 +33,54 @@ if (!hasClaude && !hasGemini) {
33
33
  }
34
34
  console.log('');
35
35
 
36
- // Copy function
36
+ // Copy function — resilient: skip files that can't be copied (e.g., EACCES from
37
+ // previous sudo install) instead of crashing the whole postinstall.
37
38
  function copyDir(src, dest) {
38
39
  if (!fs.existsSync(src)) return 0;
39
40
 
40
- if (!fs.existsSync(dest)) {
41
- fs.mkdirSync(dest, { recursive: true });
41
+ try {
42
+ if (!fs.existsSync(dest)) {
43
+ fs.mkdirSync(dest, { recursive: true });
44
+ }
45
+ } catch (e) {
46
+ return 0;
42
47
  }
43
48
 
44
- const files = fs.readdirSync(src);
49
+ let files;
50
+ try { files = fs.readdirSync(src); } catch { return 0; }
45
51
  let count = 0;
52
+ let skipped = 0;
46
53
 
47
54
  files.forEach(file => {
48
55
  const srcPath = path.join(src, file);
49
56
  const destPath = path.join(dest, file);
50
57
 
51
- if (fs.statSync(srcPath).isDirectory()) {
52
- if (!fs.existsSync(destPath)) {
53
- fs.mkdirSync(destPath, { recursive: true });
54
- }
58
+ let stat;
59
+ try { stat = fs.statSync(srcPath); } catch { return; }
60
+
61
+ if (stat.isDirectory()) {
62
+ try {
63
+ if (!fs.existsSync(destPath)) {
64
+ fs.mkdirSync(destPath, { recursive: true });
65
+ }
66
+ } catch { skipped++; return; }
55
67
  count += copyDir(srcPath, destPath);
56
68
  } else {
57
- fs.copyFileSync(srcPath, destPath);
58
- count++;
69
+ try {
70
+ fs.copyFileSync(srcPath, destPath);
71
+ count++;
72
+ } catch (e) {
73
+ // EACCES from a prior root-owned copy, EBUSY, etc — skip and continue
74
+ skipped++;
75
+ }
59
76
  }
60
77
  });
61
78
 
79
+ if (skipped > 0) {
80
+ // Surface a hint without aborting; user can sudo chown -R if they really want everything fresh
81
+ process.env._CA_COPY_SKIPS = String(Number(process.env._CA_COPY_SKIPS || 0) + skipped);
82
+ }
83
+
62
84
  return count;
63
85
  }
64
86
 
@@ -103,9 +125,13 @@ function installClaude() {
103
125
  const mcpSrc = path.join(PKG_DIR, 'mcp.json');
104
126
  const mcpDest = path.join(HOME, '.mcp.json');
105
127
  if (fs.existsSync(mcpSrc)) {
106
- fs.copyFileSync(mcpSrc, mcpDest);
107
- fs.chmodSync(mcpDest, 0o600);
108
- console.log(` šŸ”§ MCP config (7 servers)`);
128
+ try {
129
+ fs.copyFileSync(mcpSrc, mcpDest);
130
+ try { fs.chmodSync(mcpDest, 0o600); } catch {}
131
+ console.log(` šŸ”§ MCP config (7 servers)`);
132
+ } catch (e) {
133
+ console.log(` āš ļø MCP config skipped (${e.code || 'error'}): ${mcpDest}`);
134
+ }
109
135
  }
110
136
 
111
137
  // Settings - create both settings.json AND settings.local.json
@@ -122,20 +148,31 @@ function installClaude() {
122
148
 
123
149
  // Write settings.json (main config - Claude reads this)
124
150
  const settingsJsonPath = path.join(CLAUDE_DIR, 'settings.json');
125
- fs.writeFileSync(settingsJsonPath, JSON.stringify(settings, null, 2));
151
+ try {
152
+ fs.writeFileSync(settingsJsonPath, JSON.stringify(settings, null, 2));
153
+ } catch (e) {
154
+ console.log(` āš ļø settings.json skipped (${e.code || 'error'}) — try: sudo chown -R $USER ~/.claude`);
155
+ }
126
156
 
127
157
  // Write settings.local.json (backup/local overrides)
128
158
  const settingsLocalPath = path.join(CLAUDE_DIR, 'settings.local.json');
129
- fs.writeFileSync(settingsLocalPath, JSON.stringify(settings, null, 2));
130
-
131
- console.log(` āš™ļø settings.json + settings.local.json (@proactive-mode enabled)`);
159
+ try {
160
+ fs.writeFileSync(settingsLocalPath, JSON.stringify(settings, null, 2));
161
+ console.log(` āš™ļø settings.json + settings.local.json (@proactive-mode enabled)`);
162
+ } catch (e) {
163
+ console.log(` āš ļø settings.local.json skipped (${e.code || 'error'})`);
164
+ }
132
165
 
133
166
  // Copy CLAUDE.md (global instructions)
134
167
  const claudeMdSrc = path.join(PKG_DIR, 'CLAUDE.md');
135
168
  const claudeMdDest = path.join(CLAUDE_DIR, 'CLAUDE.md');
136
169
  if (fs.existsSync(claudeMdSrc)) {
137
- fs.copyFileSync(claudeMdSrc, claudeMdDest);
138
- console.log(` šŸ“‹ CLAUDE.md (global instructions)`);
170
+ try {
171
+ fs.copyFileSync(claudeMdSrc, claudeMdDest);
172
+ console.log(` šŸ“‹ CLAUDE.md (global instructions)`);
173
+ } catch (e) {
174
+ console.log(` āš ļø CLAUDE.md skipped (${e.code || 'error'})`);
175
+ }
139
176
  }
140
177
  }
141
178
 
@@ -340,6 +377,14 @@ if (hasGemini) {
340
377
 
341
378
  setupLocalBinSymlinks();
342
379
 
380
+ const skips = Number(process.env._CA_COPY_SKIPS || 0);
381
+ if (skips > 0) {
382
+ console.log('');
383
+ console.log(`āš ļø ${skips} files were skipped (likely owned by root from a prior sudo install).`);
384
+ console.log(' To force-refresh everything, run:');
385
+ console.log(' sudo chown -R $USER ~/.claude ~/.gemini 2>/dev/null && npm install -g claude-all-config');
386
+ }
387
+
343
388
  console.log('\nāœ… Installation complete!\n');
344
389
 
345
390
  if (hasClaude) {