File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/baseai/src/utils/memory Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { getDocumentContent } from './get-document-content';
6
6
import { formatDocSize } from './lib' ;
7
7
import loadMemoryConfig from './load-memory-config' ;
8
8
import { memoryConfigSchema , type MemoryConfigI } from 'types/memory' ;
9
+ import { execSync } from 'child_process' ;
9
10
10
11
export interface MemoryDocumentI {
11
12
name : string ;
@@ -64,7 +65,11 @@ export const loadMemoryFilesFromCustomDir = async ({
64
65
65
66
let allFiles : string [ ] ;
66
67
try {
67
- allFiles = await traverseDirectory ( memoryFilesPath ) ;
68
+ allFiles = execSync ( `git ls-files ${ memoryFilesPath } ` , {
69
+ encoding : 'utf-8'
70
+ } )
71
+ . split ( '\n' )
72
+ . filter ( Boolean ) ;
68
73
} catch ( error ) {
69
74
p . cancel ( `Failed to read documents in memory '${ memoryName } '.` ) ;
70
75
process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments