claudeup 4.5.1 → 4.5.2
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/src/main.js +48 -4
- package/src/main.tsx +56 -4
package/package.json
CHANGED
package/src/main.js
CHANGED
|
@@ -27,8 +27,54 @@ async function main() {
|
|
|
27
27
|
}
|
|
28
28
|
// Handle "claudeup update" - self-update command
|
|
29
29
|
if (args[0] === "update") {
|
|
30
|
-
// Detect how claudeup was installed by checking the executable path
|
|
31
30
|
const { execSync } = await import("node:child_process");
|
|
31
|
+
const { existsSync } = await import("node:fs");
|
|
32
|
+
// Detect all installations of claudeup across package managers
|
|
33
|
+
const installations = [];
|
|
34
|
+
// Check bun global
|
|
35
|
+
try {
|
|
36
|
+
const bunGlobalBin = execSync("bun pm -g bin", {
|
|
37
|
+
encoding: "utf-8",
|
|
38
|
+
timeout: 5000,
|
|
39
|
+
}).trim();
|
|
40
|
+
const bunPath = `${bunGlobalBin}/claudeup`;
|
|
41
|
+
if (existsSync(bunPath))
|
|
42
|
+
installations.push({ manager: "bun", path: bunPath });
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// bun not installed or no global claudeup
|
|
46
|
+
}
|
|
47
|
+
// Check npm global
|
|
48
|
+
try {
|
|
49
|
+
const npmPrefix = execSync("npm prefix -g", {
|
|
50
|
+
encoding: "utf-8",
|
|
51
|
+
timeout: 5000,
|
|
52
|
+
}).trim();
|
|
53
|
+
const npmPath = `${npmPrefix}/bin/claudeup`;
|
|
54
|
+
if (existsSync(npmPath))
|
|
55
|
+
installations.push({ manager: "npm", path: npmPath });
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// npm not installed or no global claudeup
|
|
59
|
+
}
|
|
60
|
+
// Warn about duplicate installations
|
|
61
|
+
if (installations.length > 1) {
|
|
62
|
+
const activePath = execSync("which claudeup", {
|
|
63
|
+
encoding: "utf-8",
|
|
64
|
+
timeout: 5000,
|
|
65
|
+
}).trim();
|
|
66
|
+
console.log(`⚠ claudeup is installed via multiple package managers:\n`);
|
|
67
|
+
for (const inst of installations) {
|
|
68
|
+
const tag = inst.path === activePath ? " (active)" : " (shadowed)";
|
|
69
|
+
console.log(` ${inst.manager}: ${inst.path}${tag}`);
|
|
70
|
+
}
|
|
71
|
+
console.log(`\nTo fix, keep one and remove the other:`);
|
|
72
|
+
for (const inst of installations) {
|
|
73
|
+
console.log(` ${inst.manager} uninstall -g claudeup`);
|
|
74
|
+
}
|
|
75
|
+
console.log();
|
|
76
|
+
}
|
|
77
|
+
// Determine which package manager to use for the update
|
|
32
78
|
let usesBun = false;
|
|
33
79
|
try {
|
|
34
80
|
const claudeupPath = execSync("which claudeup", {
|
|
@@ -42,9 +88,7 @@ async function main() {
|
|
|
42
88
|
}
|
|
43
89
|
const pkgManager = usesBun ? "bun" : "npm";
|
|
44
90
|
console.log(`Updating claudeup using ${pkgManager}...`);
|
|
45
|
-
const installArgs =
|
|
46
|
-
? ["install", "-g", "claudeup@latest"]
|
|
47
|
-
: ["install", "-g", "claudeup@latest"];
|
|
91
|
+
const installArgs = ["install", "-g", "claudeup@latest"];
|
|
48
92
|
const proc = spawn(pkgManager, installArgs, {
|
|
49
93
|
stdio: "inherit",
|
|
50
94
|
shell: false, // Avoid shell for security (fixes DEP0190 warning)
|
package/src/main.tsx
CHANGED
|
@@ -38,8 +38,62 @@ async function main(): Promise<void> {
|
|
|
38
38
|
|
|
39
39
|
// Handle "claudeup update" - self-update command
|
|
40
40
|
if (args[0] === "update") {
|
|
41
|
-
// Detect how claudeup was installed by checking the executable path
|
|
42
41
|
const { execSync } = await import("node:child_process");
|
|
42
|
+
const { existsSync } = await import("node:fs");
|
|
43
|
+
|
|
44
|
+
// Detect all installations of claudeup across package managers
|
|
45
|
+
const installations: Array<{
|
|
46
|
+
manager: "bun" | "npm";
|
|
47
|
+
path: string;
|
|
48
|
+
}> = [];
|
|
49
|
+
|
|
50
|
+
// Check bun global
|
|
51
|
+
try {
|
|
52
|
+
const bunGlobalBin = execSync("bun pm -g bin", {
|
|
53
|
+
encoding: "utf-8",
|
|
54
|
+
timeout: 5000,
|
|
55
|
+
}).trim();
|
|
56
|
+
const bunPath = `${bunGlobalBin}/claudeup`;
|
|
57
|
+
if (existsSync(bunPath)) installations.push({ manager: "bun", path: bunPath });
|
|
58
|
+
} catch {
|
|
59
|
+
// bun not installed or no global claudeup
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Check npm global
|
|
63
|
+
try {
|
|
64
|
+
const npmPrefix = execSync("npm prefix -g", {
|
|
65
|
+
encoding: "utf-8",
|
|
66
|
+
timeout: 5000,
|
|
67
|
+
}).trim();
|
|
68
|
+
const npmPath = `${npmPrefix}/bin/claudeup`;
|
|
69
|
+
if (existsSync(npmPath)) installations.push({ manager: "npm", path: npmPath });
|
|
70
|
+
} catch {
|
|
71
|
+
// npm not installed or no global claudeup
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Warn about duplicate installations
|
|
75
|
+
if (installations.length > 1) {
|
|
76
|
+
const activePath = execSync("which claudeup", {
|
|
77
|
+
encoding: "utf-8",
|
|
78
|
+
timeout: 5000,
|
|
79
|
+
}).trim();
|
|
80
|
+
|
|
81
|
+
console.log(
|
|
82
|
+
`⚠ claudeup is installed via multiple package managers:\n`,
|
|
83
|
+
);
|
|
84
|
+
for (const inst of installations) {
|
|
85
|
+
const tag =
|
|
86
|
+
inst.path === activePath ? " (active)" : " (shadowed)";
|
|
87
|
+
console.log(` ${inst.manager}: ${inst.path}${tag}`);
|
|
88
|
+
}
|
|
89
|
+
console.log(`\nTo fix, keep one and remove the other:`);
|
|
90
|
+
for (const inst of installations) {
|
|
91
|
+
console.log(` ${inst.manager} uninstall -g claudeup`);
|
|
92
|
+
}
|
|
93
|
+
console.log();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Determine which package manager to use for the update
|
|
43
97
|
let usesBun = false;
|
|
44
98
|
try {
|
|
45
99
|
const claudeupPath = execSync("which claudeup", {
|
|
@@ -54,9 +108,7 @@ async function main(): Promise<void> {
|
|
|
54
108
|
const pkgManager = usesBun ? "bun" : "npm";
|
|
55
109
|
console.log(`Updating claudeup using ${pkgManager}...`);
|
|
56
110
|
|
|
57
|
-
const installArgs =
|
|
58
|
-
? ["install", "-g", "claudeup@latest"]
|
|
59
|
-
: ["install", "-g", "claudeup@latest"];
|
|
111
|
+
const installArgs = ["install", "-g", "claudeup@latest"];
|
|
60
112
|
|
|
61
113
|
const proc = spawn(pkgManager, installArgs, {
|
|
62
114
|
stdio: "inherit",
|