mirror of
https://github.com/obra/superpowers.git
synced 2026-05-03 15:49:04 +08:00
Migrate conversation search to use PERSONAL_SUPERPOWERS_DIR
Updates conversation indexing and search to use the new personal superpowers directory structure with environment variable support. Changes: - Added src/paths.ts for centralized directory resolution - Updated db.ts, indexer.ts, verify.ts to use paths.ts - Created migrate-to-config.sh for data migration from ~/.clank - Updated all documentation references from ~/.clank to ~/.config/superpowers - Database paths automatically updated during migration Migration tested with 5,017 conversations and 6,385 exchanges.
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
import { verifyIndex, repairIndex } from './verify.js';
|
||||
import { indexSession, indexUnprocessed, indexConversations } from './indexer.js';
|
||||
import { initDatabase } from './db.js';
|
||||
import { getDbPath, getArchiveDir } from './paths.js';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import os from 'os';
|
||||
|
||||
const command = process.argv[2];
|
||||
|
||||
@@ -74,14 +74,14 @@ async function main() {
|
||||
console.log('Rebuilding entire index...');
|
||||
|
||||
// Delete database
|
||||
const dbPath = path.join(os.homedir(), '.clank', 'conversation-index', 'db.sqlite');
|
||||
const dbPath = getDbPath();
|
||||
if (fs.existsSync(dbPath)) {
|
||||
fs.unlinkSync(dbPath);
|
||||
console.log('Deleted existing database');
|
||||
}
|
||||
|
||||
// Delete all summary files
|
||||
const archiveDir = path.join(os.homedir(), '.clank', 'conversation-archive');
|
||||
const archiveDir = getArchiveDir();
|
||||
if (fs.existsSync(archiveDir)) {
|
||||
const projects = fs.readdirSync(archiveDir);
|
||||
for (const project of projects) {
|
||||
|
||||
Reference in New Issue
Block a user