File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed
packages/gpt-runner-core/src Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export class Openai {
11
11
'Content-Type' : 'application/json' ,
12
12
'Authorization' : `Bearer ${ openaiKey } ` ,
13
13
} ,
14
+ rejectUnauthorized : false , // ignore ssl certificate errors
15
+
14
16
} ,
15
17
( response ) => {
16
18
let responseData = ''
Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ export async function createAnything({
41
41
} )
42
42
43
43
try {
44
- const filepaths = JSON . parse ( filepathsJson ) as string [ ]
44
+ // eslint-disable-next-line no-eval
45
+ const filepaths = eval ( filepathsJson ) as string [ ]
45
46
46
47
let sharedDependenciesInfo = await FileManager . readFile ( {
47
48
directory,
@@ -105,5 +106,6 @@ export async function createAnything({
105
106
}
106
107
catch ( e ) {
107
108
console . error ( 'Failed to parse result:' , filepathsJson )
109
+ console . error ( e )
108
110
}
109
111
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class FileManager {
46
46
directory,
47
47
exclude,
48
48
} : ReadDirParams ) {
49
- const isExit = await fs . stat ( directory ) . then ( stat => stat . isDirectory ( ) )
49
+ const isExit = existsSync ( directory ) && statSync ( directory ) . isDirectory ( )
50
50
const relativePathContentMap : Record < string , string > = { }
51
51
52
52
if ( ! isExit )
@@ -104,7 +104,7 @@ export class FileManager {
104
104
directory,
105
105
exclude,
106
106
} : CleanDirParams ) {
107
- const isExit = await fs . stat ( directory ) . then ( stat => stat . isDirectory ( ) )
107
+ const isExit = existsSync ( directory ) && statSync ( directory ) . isDirectory ( )
108
108
if ( ! isExit )
109
109
return
110
110
You can’t perform that action at this time.
0 commit comments