Skip to content

Commit 3f03e0b

Browse files
johnlindquistclaude
andcommitted
fix: ensure db directory exists in npm tests to fix Windows CI
The Windows CI was failing because the db directory didn't exist when tests tried to write stats.json. Added ensureDir for the db directory in test setup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5d1a1ea commit 3f03e0b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/api/npm.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ await tmp.withDir(async (dir) => {
2424

2525
await ensureDir(kenvPath())
2626
await ensureDir(kitPath())
27+
await ensureDir(kitPath("db"))
2728

2829

2930
t.log({

src/target/app.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -475,23 +475,23 @@ let runAction = async (data: AppMessage) => {
475475
// shortcut: data?.state?.shortcut,
476476
// mapKeys: Array.from(global.__kitActionsMap.keys())
477477
// })
478-
478+
479479
let action: Action | Shortcut
480480
// Try multiple ways to find the action
481481
const possibleKeys = [
482482
data?.state?.action?.name,
483483
data?.state?.action?.flag,
484484
data?.state?.action?.value,
485485
].filter(Boolean)
486-
486+
487487
for (const key of possibleKeys) {
488488
if (global.__kitActionsMap.has(key)) {
489489
action = global.__kitActionsMap.get(key)
490490
// console.log(`[SDK] Found action with key: ${key}`)
491491
break
492492
}
493493
}
494-
494+
495495
if (!action && data?.state?.shortcut) {
496496
for (let [
497497
key,
@@ -502,14 +502,14 @@ let runAction = async (data: AppMessage) => {
502502
value?.key === data.state.shortcut
503503
) {
504504
action = value
505-
console.log(`[SDK] Found action by shortcut: ${data.state.shortcut}`)
505+
// console.log(`[SDK] Found action by shortcut: ${data.state.shortcut}`)
506506
break
507507
}
508508
}
509509
}
510-
510+
511511
if (!action) {
512-
console.log(`[SDK] No action found for:`, data?.state)
512+
// console.log(`[SDK] No action found for:`, data?.state)
513513
}
514514

515515
if (action) {
@@ -1183,7 +1183,7 @@ global.kitPrompt = async (config: PromptConfig) => {
11831183

11841184
global.__currentPromptConfig = config
11851185
await prepPrompt(config)
1186-
1186+
11871187
// Send flags to renderer if they exist (including actions converted to flags)
11881188
if (config.flags) {
11891189
await global.setFlags(config.flags)

0 commit comments

Comments
 (0)