claude-code-autoconfig 1.0.7 → 1.0.8
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/bin/cli.js +36 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -7,9 +7,43 @@ const { execSync, spawn } = require('child_process');
|
|
|
7
7
|
const cwd = process.cwd();
|
|
8
8
|
const packageDir = path.dirname(__dirname);
|
|
9
9
|
|
|
10
|
+
// Reserved Windows device names - never create files with these names
|
|
11
|
+
const WINDOWS_RESERVED = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4',
|
|
12
|
+
'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5',
|
|
13
|
+
'LPT6', 'LPT7', 'LPT8', 'LPT9'];
|
|
14
|
+
|
|
15
|
+
function isReservedName(name) {
|
|
16
|
+
const baseName = name.replace(/\.[^.]*$/, '').toUpperCase();
|
|
17
|
+
return WINDOWS_RESERVED.includes(baseName);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Clean up any accidentally created reserved files
|
|
21
|
+
function cleanupReservedFiles(dir) {
|
|
22
|
+
if (!fs.existsSync(dir)) return;
|
|
23
|
+
try {
|
|
24
|
+
const entries = fs.readdirSync(dir);
|
|
25
|
+
for (const entry of entries) {
|
|
26
|
+
if (isReservedName(entry)) {
|
|
27
|
+
const filePath = path.join(dir, entry);
|
|
28
|
+
try {
|
|
29
|
+
fs.unlinkSync(filePath);
|
|
30
|
+
console.log('\x1b[33m%s\x1b[0m', `⚠️ Removed invalid file: ${entry}`);
|
|
31
|
+
} catch (e) {
|
|
32
|
+
// May fail on Windows - that's ok
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} catch (e) {
|
|
37
|
+
// Ignore errors
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
10
41
|
console.log('\x1b[36m%s\x1b[0m', '🚀 Claude Code Autoconfig');
|
|
11
42
|
console.log();
|
|
12
43
|
|
|
44
|
+
// Clean up any reserved files from previous installs
|
|
45
|
+
cleanupReservedFiles(cwd);
|
|
46
|
+
|
|
13
47
|
// Step 1: Check if Claude Code is installed
|
|
14
48
|
function isClaudeInstalled() {
|
|
15
49
|
try {
|
|
@@ -54,6 +88,7 @@ function copyDirForBackup(src, dest) {
|
|
|
54
88
|
|
|
55
89
|
for (const entry of entries) {
|
|
56
90
|
if (SKIP_FILES.includes(entry.name)) continue;
|
|
91
|
+
if (isReservedName(entry.name)) continue;
|
|
57
92
|
|
|
58
93
|
const srcPath = path.join(src, entry.name);
|
|
59
94
|
const destPath = path.join(dest, entry.name);
|
|
@@ -152,6 +187,7 @@ function copyDir(src, dest) {
|
|
|
152
187
|
|
|
153
188
|
for (const entry of entries) {
|
|
154
189
|
if (SKIP_FILES.includes(entry.name)) continue;
|
|
190
|
+
if (isReservedName(entry.name)) continue;
|
|
155
191
|
|
|
156
192
|
const srcPath = path.join(src, entry.name);
|
|
157
193
|
const destPath = path.join(dest, entry.name);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-autoconfig",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Intelligent, self-configuring setup for Claude Code. One command analyzes your project, configures Claude, and shows you what it did.",
|
|
5
5
|
"author": "ADAC 1001 <info@adac1001.com>",
|
|
6
6
|
"license": "MIT",
|