There was an error while loading. Please reload this page.
1 parent 1a81521 commit 40295e4Copy full SHA for 40295e4
1 file changed
src/config/paths.ts
@@ -79,7 +79,11 @@ function hasInitializedDataDir(dir: string): boolean {
79
try {
80
const stats = statSync(dir)
81
if (!stats.isDirectory()) return true
82
- return readdirSync(dir).length > 0
+ // Check for the database file as proof of actual data initialization.
83
+ // A directory with only leftover subdirectories (workspace/, skills/) from
84
+ // older versions should NOT be considered initialized — otherwise the
85
+ // migration from the legacy data dir would be incorrectly skipped.
86
+ return existsSync(resolve(dir, 'youclaw.db'))
87
} catch {
88
return false
89
}
0 commit comments