File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
packages/ethereum-viewer/src Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -105,15 +105,14 @@ async function saveSingleContractFilesToFs(
105105 const withPrefix = ( file : string ) =>
106106 options . prefix ? options . prefix + file : file ;
107107
108- const entries = Object . entries ( result . files ) ;
109- for ( const [ path , content ] of entries ) {
110- fs . writeFile ( withPrefix ( path ) , content ) ;
111- }
112-
108+ let entries = Object . entries ( result . files ) ;
113109 const mainFile = getMainContractFile ( entries , result . info ) ;
114-
115110 if ( options . includeMainInfo ) {
116- fs . writeFile ( withPrefix ( "main.md" ) , `Main file: ${ mainFile } ` ) ;
111+ entries . push ( [ "main.md" , `Main file: ${ mainFile } ` ] ) ;
112+ }
113+ entries = entries . map ( ( x ) => [ withPrefix ( x [ 0 ] ) , x [ 1 ] ] ) ;
114+ for ( const [ path , content ] of entries ) {
115+ fs . writeFile ( path , content ) ;
117116 }
118117
119118 return {
You can’t perform that action at this time.
0 commit comments