patchcord 0.4.0 → 0.4.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/bin/patchcord.mjs +7 -1
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -81,7 +81,7 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
81
81
|
const flags = cmd?.startsWith("--") ? process.argv.slice(2) : process.argv.slice(3);
|
|
82
82
|
const fullStatusline = flags.includes("--full");
|
|
83
83
|
let wasPluginInstalled = false;
|
|
84
|
-
const { readFileSync, writeFileSync, unlinkSync } = await import("fs");
|
|
84
|
+
const { readFileSync, writeFileSync, unlinkSync, rmSync } = await import("fs");
|
|
85
85
|
|
|
86
86
|
function safeReadJson(filePath) {
|
|
87
87
|
try {
|
|
@@ -116,6 +116,12 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd === "--token" || cmd ===
|
|
|
116
116
|
// Claude Code
|
|
117
117
|
const hasClaude = run("which claude");
|
|
118
118
|
if (hasClaude) {
|
|
119
|
+
// Remove legacy npm-cache install (pre-marketplace era) — causes duplicate /patchcord commands.
|
|
120
|
+
const npmCachePatchcord = join(HOME, ".claude", "plugins", "npm-cache", "node_modules", "patchcord");
|
|
121
|
+
if (existsSync(npmCachePatchcord)) {
|
|
122
|
+
try { rmSync(npmCachePatchcord, { recursive: true, force: true }); } catch {}
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
// Always re-add marketplace (copies fresh files from this npx package)
|
|
120
126
|
// and install/update plugin. Claude Code's built-in plugin update
|
|
121
127
|
// doesn't detect new versions from local sources (#37252).
|