@suwujs/codex-vault 0.3.2 → 0.3.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/bin/cli.js +1 -16
- package/package.json +1 -1
- package/plugin/VERSION +1 -1
package/bin/cli.js
CHANGED
|
@@ -269,7 +269,6 @@ function cleanHooksJson(filePath, label) {
|
|
|
269
269
|
if (Object.keys(data).length === 0) {
|
|
270
270
|
fs.unlinkSync(filePath);
|
|
271
271
|
console.log(` [x] Removed ${label} (empty after cleanup)`);
|
|
272
|
-
cleanEmptyParents(path.dirname(filePath));
|
|
273
272
|
} else {
|
|
274
273
|
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
|
|
275
274
|
console.log(` [x] Cleaned codex-vault hooks from ${label}`);
|
|
@@ -302,7 +301,6 @@ function cleanCodexConfigToml(cwd) {
|
|
|
302
301
|
if (content.trim() === '') {
|
|
303
302
|
fs.unlinkSync(filePath);
|
|
304
303
|
console.log(' [x] Removed .codex/config.toml (empty after cleanup)');
|
|
305
|
-
cleanEmptyParents(path.dirname(filePath));
|
|
306
304
|
} else {
|
|
307
305
|
fs.writeFileSync(filePath, content);
|
|
308
306
|
console.log(' [x] Cleaned codex_hooks from .codex/config.toml');
|
|
@@ -329,12 +327,9 @@ function removeSkills(agentDir, label, skillNames) {
|
|
|
329
327
|
|
|
330
328
|
console.log(` [x] Removed ${removed} skills from ${label}/skills/`);
|
|
331
329
|
|
|
332
|
-
// Clean up empty
|
|
330
|
+
// Clean up empty skills/ directory only — never delete the agent dir itself
|
|
333
331
|
if (isDirEmpty(skillsDir)) {
|
|
334
332
|
fs.rmdirSync(skillsDir);
|
|
335
|
-
if (isDirEmpty(agentDir)) {
|
|
336
|
-
fs.rmdirSync(agentDir);
|
|
337
|
-
}
|
|
338
333
|
}
|
|
339
334
|
}
|
|
340
335
|
|
|
@@ -409,13 +404,3 @@ function isDirEmpty(dirPath) {
|
|
|
409
404
|
}
|
|
410
405
|
}
|
|
411
406
|
|
|
412
|
-
/**
|
|
413
|
-
* Remove empty parent directories up to (but not including) cwd.
|
|
414
|
-
*/
|
|
415
|
-
function cleanEmptyParents(dirPath) {
|
|
416
|
-
const cwd = process.cwd();
|
|
417
|
-
if (dirPath === cwd || !dirPath.startsWith(cwd)) return;
|
|
418
|
-
if (isDirEmpty(dirPath)) {
|
|
419
|
-
fs.rmdirSync(dirPath);
|
|
420
|
-
}
|
|
421
|
-
}
|
package/package.json
CHANGED
package/plugin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.3
|