mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
fix: stabilize windows hook and claw tests
This commit is contained in:
@@ -144,10 +144,11 @@ function searchSessions(query, dir) {
|
||||
const q = String(query || '').toLowerCase().trim();
|
||||
if (!q) return [];
|
||||
|
||||
const sessions = listSessions(dir);
|
||||
const sessionDir = dir || getClawDir();
|
||||
const sessions = listSessions(sessionDir);
|
||||
const results = [];
|
||||
for (const name of sessions) {
|
||||
const p = getSessionPath(name);
|
||||
const p = path.join(sessionDir, `${name}.md`);
|
||||
const content = loadHistory(p);
|
||||
if (!content) continue;
|
||||
|
||||
@@ -212,12 +213,12 @@ function exportSession(filePath, format, outputPath) {
|
||||
return { ok: false, message: `Unsupported export format: ${format}` };
|
||||
}
|
||||
|
||||
function branchSession(currentSessionPath, newSessionName) {
|
||||
function branchSession(currentSessionPath, newSessionName, targetDir = getClawDir()) {
|
||||
if (!isValidSessionName(newSessionName)) {
|
||||
return { ok: false, message: `Invalid branch session name: ${newSessionName}` };
|
||||
}
|
||||
|
||||
const target = getSessionPath(newSessionName);
|
||||
const target = path.join(targetDir, `${newSessionName}.md`);
|
||||
fs.mkdirSync(path.dirname(target), { recursive: true });
|
||||
|
||||
const content = loadHistory(currentSessionPath);
|
||||
|
||||
Reference in New Issue
Block a user