Skip to content

Commit 0f392f0

Browse files
fix(handoff): create .stackmemory directory before writing handoff file
Fixes ENOENT error when running handoff in a project without an existing .stackmemory directory. Now creates the directory with recursive: true before attempting to write last-handoff.md.
1 parent 80a51a2 commit 0f392f0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/cli/commands/handoff.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ Generated by stackmemory handoff at ${timestamp}
316316
}
317317

318318
// 7. Save handoff prompt (both latest and versioned)
319-
const handoffPath = join(
320-
projectRoot,
321-
'.stackmemory',
322-
'last-handoff.md'
323-
);
319+
const stackmemoryDir = join(projectRoot, '.stackmemory');
320+
if (!existsSync(stackmemoryDir)) {
321+
mkdirSync(stackmemoryDir, { recursive: true });
322+
}
323+
const handoffPath = join(stackmemoryDir, 'last-handoff.md');
324324
writeFileSync(handoffPath, handoffPrompt);
325325

326326
// Save versioned copy

0 commit comments

Comments
 (0)