Merge remote-tracking branch 'origin/main' into fix-and-ship-codex-mem-search-access
# Conflicts: # .mcp.json # plugin/.mcp.json # plugin/scripts/mcp-server.cjs # plugin/scripts/worker-service.cjs # tests/infrastructure/plugin-distribution.test.ts
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -32,6 +32,24 @@ function emitUpgradeHint(message) {
|
||||
}
|
||||
}
|
||||
|
||||
const LEGACY_VERSION_MARKER_RE =
|
||||
/^v?\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
||||
|
||||
function readInstallMarkerVersion(markerPath) {
|
||||
const content = readFileSync(markerPath, 'utf-8');
|
||||
try {
|
||||
const marker = JSON.parse(content);
|
||||
return marker && typeof marker === 'object' && typeof marker.version === 'string'
|
||||
? marker.version
|
||||
: null;
|
||||
} catch {
|
||||
const legacyVersion = content.trim();
|
||||
return LEGACY_VERSION_MARKER_RE.test(legacyVersion)
|
||||
? legacyVersion.replace(/^v/i, '')
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const pkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf-8'));
|
||||
const markerPath = join(ROOT, '.install-version');
|
||||
@@ -39,8 +57,10 @@ try {
|
||||
emitUpgradeHint('claude-mem: runtime not yet set up - run: npx claude-mem@latest install');
|
||||
process.exit(0);
|
||||
}
|
||||
const marker = JSON.parse(readFileSync(markerPath, 'utf-8'));
|
||||
if (marker.version !== pkg.version) {
|
||||
const markerVersion = readInstallMarkerVersion(markerPath);
|
||||
if (!markerVersion) {
|
||||
emitUpgradeHint('claude-mem: install marker unreadable - run: npx claude-mem@latest install');
|
||||
} else if (markerVersion !== pkg.version) {
|
||||
emitUpgradeHint(`claude-mem: upgraded to v${pkg.version} - run: npx claude-mem@latest install`);
|
||||
}
|
||||
} catch {
|
||||
|
||||
+190
-182
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user