@suwujs/codex-vault 0.3.3 → 0.3.4
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 +17 -4
- package/package.json +1 -1
- package/plugin/VERSION +1 -1
package/bin/cli.js
CHANGED
|
@@ -64,12 +64,19 @@ function assertBash() {
|
|
|
64
64
|
function runInit() {
|
|
65
65
|
assertBash();
|
|
66
66
|
|
|
67
|
-
// Check if already installed
|
|
67
|
+
// Check if already installed (including legacy codex-mem)
|
|
68
68
|
const versionFile = path.join(process.cwd(), 'vault', '.codex-vault', 'version');
|
|
69
|
+
const legacyVersionFile = path.join(process.cwd(), 'vault', '.codex-mem', 'version');
|
|
69
70
|
if (fs.existsSync(versionFile)) {
|
|
70
71
|
const installed = fs.readFileSync(versionFile, 'utf8').trim();
|
|
71
72
|
console.log(`codex-vault v${installed} is already installed in this directory.`);
|
|
72
|
-
console.log('
|
|
73
|
+
console.log('Run "codex-vault upgrade" to update, or remove vault/.codex-vault/version to reinstall.');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (fs.existsSync(legacyVersionFile)) {
|
|
77
|
+
const installed = fs.readFileSync(legacyVersionFile, 'utf8').trim();
|
|
78
|
+
console.log(`Legacy codex-mem v${installed} detected.`);
|
|
79
|
+
console.log('Run "codex-vault uninstall" first, then "codex-vault init".');
|
|
73
80
|
return;
|
|
74
81
|
}
|
|
75
82
|
|
|
@@ -98,13 +105,19 @@ function runInit() {
|
|
|
98
105
|
function cmdUpgrade() {
|
|
99
106
|
assertBash();
|
|
100
107
|
|
|
101
|
-
// Check if installed
|
|
108
|
+
// Check if installed (including legacy codex-mem)
|
|
102
109
|
const versionFile = path.join(process.cwd(), 'vault', '.codex-vault', 'version');
|
|
103
|
-
|
|
110
|
+
const legacyVersionFile = path.join(process.cwd(), 'vault', '.codex-mem', 'version');
|
|
111
|
+
if (!fs.existsSync(versionFile) && !fs.existsSync(legacyVersionFile)) {
|
|
104
112
|
console.error('codex-vault is not installed in this directory.');
|
|
105
113
|
console.error('Run "codex-vault init" first.');
|
|
106
114
|
process.exit(1);
|
|
107
115
|
}
|
|
116
|
+
if (!fs.existsSync(versionFile) && fs.existsSync(legacyVersionFile)) {
|
|
117
|
+
console.error('Legacy codex-mem installation detected.');
|
|
118
|
+
console.error('Run "codex-vault uninstall" first, then "codex-vault init".');
|
|
119
|
+
process.exit(1);
|
|
120
|
+
}
|
|
108
121
|
|
|
109
122
|
const installedVersion = fs.readFileSync(versionFile, 'utf8').trim();
|
|
110
123
|
|
package/package.json
CHANGED
package/plugin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.3.
|
|
1
|
+
0.3.4
|