great-cto 0.1.2 → 0.1.3
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/dist/installer.js +8 -6
- package/package.json +1 -1
package/dist/installer.js
CHANGED
|
@@ -74,17 +74,19 @@ export function install(opts = {}) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
const pluginDir = join(getPluginBaseDir(), version);
|
|
77
|
-
if (existsSync(pluginDir)
|
|
78
|
-
// Verify it has plugin.json (otherwise corrupted install)
|
|
77
|
+
if (existsSync(pluginDir)) {
|
|
79
78
|
const manifest = join(pluginDir, ".claude-plugin", "plugin.json");
|
|
80
|
-
|
|
79
|
+
const looksValid = existsSync(manifest);
|
|
80
|
+
if (looksValid && !opts.force) {
|
|
81
81
|
return { installed: false, pluginDir, version, alreadyInstalled: true };
|
|
82
82
|
}
|
|
83
|
-
//
|
|
84
|
-
|
|
83
|
+
// Either corrupted, or --force: wipe and reinstall
|
|
84
|
+
if (!looksValid) {
|
|
85
|
+
warn(`Previous install at ${pluginDir} looks corrupted — reinstalling.`);
|
|
86
|
+
}
|
|
85
87
|
rmSync(pluginDir, { recursive: true, force: true });
|
|
86
88
|
}
|
|
87
|
-
mkdirSync(
|
|
89
|
+
mkdirSync(getPluginBaseDir(), { recursive: true });
|
|
88
90
|
log(dim(` cloning ${REPO_URL} into ${pluginDir}`));
|
|
89
91
|
const ref = /^[0-9]+\.[0-9]+\.[0-9]+$/.test(version) ? `v${version}` : version;
|
|
90
92
|
const result = spawnSync("git", ["clone", "--depth=1", "--branch", ref, REPO_URL, pluginDir], {
|
package/package.json
CHANGED