File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,11 @@ const cli = meow(`
5353 alias : 'u' ,
5454 isMultiple : true
5555 } ,
56+ // https://github.com/sindresorhus/meow/issues/158
57+ // options: {
58+ // type: 'string',
59+ // isMultiple: true
60+ // },
5661 root : {
5762 type : 'string' ,
5863 alias : 'r' ,
@@ -65,13 +70,15 @@ const cli = meow(`
6570 }
6671} ) ;
6772
68- const read = file => new Promise ( resolve => fs . readFile ( file , 'utf8' , ( error , data ) => {
69- if ( error ) {
70- console . warn ( error ) ;
71- }
73+ const read = file => new Promise ( resolve => {
74+ fs . readFile ( file , 'utf8' , ( error , data ) => {
75+ if ( error ) {
76+ console . warn ( error ) ;
77+ }
7278
73- resolve ( data ) ;
74- } ) ) ;
79+ resolve ( data ) ;
80+ } ) ;
81+ } ) ;
7582
7683const interopRequire = object => object && object . __esModule ? object . default : object ;
7784
@@ -86,7 +93,7 @@ const processing = async file => {
8693
8794 makeDir ( path . dirname ( output ) )
8895 . then ( read . bind ( undefined , file ) )
89- . then ( html => posthtml ( plugins ) . process ( html ) )
96+ . then ( html => Promise . resolve ( posthtml ( plugins ) . process ( html , config . options ) ) )
9097 . then ( ( { html} ) => {
9198 fs . writeFile ( output , html , error => {
9299 if ( error ) {
You can’t perform that action at this time.
0 commit comments