File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -65,23 +65,23 @@ const writeIconComponents = async (buildPath, components) => {
65
65
}
66
66
67
67
const buildIconBodyList = ( svgPath , svgList ) => {
68
- return svgList . map ( svg => ( {
68
+ return Promise . all ( svgList . map ( async svg => ( {
69
69
name : toPascalCase ( svg ) . slice ( 0 , - 4 ) ,
70
- path : async ( ) => {
70
+ path : await ( async ( ) => {
71
71
const svgFile = await readFileAsync ( path . join ( svgPath , svg ) )
72
72
const matches = / \s d = " ( .* ) " / . exec ( svgFile )
73
73
74
74
return matches ? matches [ 0 ] : undefined
75
- }
76
- } ) )
75
+ } ) ( )
76
+ } ) ) )
77
77
}
78
78
79
79
fs . readdir ( SVG_PATH , async ( err , svgList ) => {
80
80
if ( err ) {
81
81
throw new Error ( err )
82
82
}
83
83
84
- const svgBodyList = buildIconBodyList ( SVG_PATH , svgList )
84
+ const svgBodyList = await buildIconBodyList ( SVG_PATH , svgList )
85
85
const iconComponents = await buildIconComponents ( TPL_PATH , svgBodyList )
86
86
await writeIconComponents ( BUILD_PATH , iconComponents )
87
87
await copyPackage ( PKG_FILE , path . resolve ( DIST_PATH , 'package.json' ) )
You can’t perform that action at this time.
0 commit comments