File tree 2 files changed +7
-3
lines changed 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
export type FileSystem = {
2
2
fileExists : ( filePath : string ) => Promise < boolean > ;
3
- readFile : ( filePath : string ) => Promise < Error | string > ;
4
- writeFile : ( filePath : string , contents : string ) => Promise < Error | undefined > ;
3
+ readFile : ( filePath : string ) => Promise < NodeJS . ErrnoException | string > ;
4
+ writeFile : ( filePath : string , contents : string ) => Promise < NodeJS . ErrnoException | undefined > ;
5
5
} ;
Original file line number Diff line number Diff line change @@ -16,7 +16,11 @@ export const convertFileComments = async (
16
16
) => {
17
17
const fileContent = await dependencies . fileSystem . readFile ( filePath ) ;
18
18
if ( fileContent instanceof Error ) {
19
- return fileContent ;
19
+ if ( fileContent . code === "EISDIR" ) {
20
+ return undefined ;
21
+ } else {
22
+ return fileContent ;
23
+ }
20
24
}
21
25
22
26
const comments = parseFileComments ( filePath , fileContent ) ;
You can’t perform that action at this time.
0 commit comments