@suwujs/codex-vault 0.3.0 → 0.3.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/cli.js +14 -9
- package/package.json +1 -1
- package/plugin/VERSION +1 -1
package/bin/cli.js
CHANGED
|
@@ -166,22 +166,26 @@ function cmdUninstall() {
|
|
|
166
166
|
const cwd = process.cwd();
|
|
167
167
|
const versionFile = path.join(cwd, 'vault', '.codex-vault', 'version');
|
|
168
168
|
|
|
169
|
-
// 1. Check installation
|
|
170
|
-
|
|
169
|
+
// 1. Check installation (also check legacy .codex-mem path)
|
|
170
|
+
const legacyVersionFile = path.join(cwd, 'vault', '.codex-mem', 'version');
|
|
171
|
+
if (!fs.existsSync(versionFile) && !fs.existsSync(legacyVersionFile)) {
|
|
171
172
|
console.error('codex-vault is not installed in this directory.');
|
|
172
173
|
console.error('Nothing to uninstall.');
|
|
173
174
|
process.exit(1);
|
|
174
175
|
}
|
|
175
176
|
|
|
176
|
-
const
|
|
177
|
+
const activeVersionFile = fs.existsSync(versionFile) ? versionFile : legacyVersionFile;
|
|
178
|
+
const installedVersion = fs.readFileSync(activeVersionFile, 'utf8').trim();
|
|
177
179
|
console.log(`Uninstalling codex-vault v${installedVersion}...`);
|
|
178
180
|
console.log('NOTE: vault/ data (brain/, work/, sources/) is preserved.\n');
|
|
179
181
|
|
|
180
|
-
// 2. Remove vault/.codex-vault/ (hooks + version + backups)
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
fs.
|
|
184
|
-
|
|
182
|
+
// 2. Remove vault/.codex-vault/ and legacy vault/.codex-mem/ (hooks + version + backups)
|
|
183
|
+
for (const dirName of ['.codex-vault', '.codex-mem']) {
|
|
184
|
+
const dir = path.join(cwd, 'vault', dirName);
|
|
185
|
+
if (fs.existsSync(dir)) {
|
|
186
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
187
|
+
console.log(` [x] Removed vault/${dirName}/`);
|
|
188
|
+
}
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
// 3. Clean .claude/settings.json
|
|
@@ -239,7 +243,8 @@ function cleanHooksJson(filePath, label) {
|
|
|
239
243
|
const hooks = entry.hooks || [];
|
|
240
244
|
// Keep the entry only if none of its hook commands belong to codex-vault
|
|
241
245
|
const isVaultEntry = hooks.some(
|
|
242
|
-
(h) => typeof h.command === 'string' &&
|
|
246
|
+
(h) => typeof h.command === 'string' &&
|
|
247
|
+
(h.command.includes('codex-vault/hooks/') || h.command.includes('codex-mem/hooks/'))
|
|
243
248
|
);
|
|
244
249
|
return !isVaultEntry;
|
|
245
250
|
});
|
package/package.json
CHANGED
package/plugin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.1
|