@@ -8,6 +8,7 @@ import { fdir, PathsOutput } from "fdir";
8
8
import frontmatter from "front-matter" ;
9
9
import caporal from "@caporal/core" ;
10
10
import chalk from "chalk" ;
11
+ import cliProgress from "cli-progress" ;
11
12
import inquirer from "inquirer" ;
12
13
import openEditor from "open-editor" ;
13
14
import open from "open" ;
@@ -752,15 +753,28 @@ program
752
753
const allDocs = await Document . findAll ( {
753
754
locales : new Map ( [ [ locale . toLowerCase ( ) , true ] ] ) ,
754
755
} ) ;
756
+ const progressBar = new cliProgress . SingleBar (
757
+ { } ,
758
+ cliProgress . Presets . shades_grey
759
+ ) ;
760
+ progressBar . start ( allDocs . count , 0 ) ;
761
+
755
762
for ( const document of allDocs . iterDocs ( ) ) {
756
- if ( fileTypes . includes ( document . isMarkdown ? "md" : "html" ) ) {
757
- await buildDocument ( document , {
758
- fixFlaws : true ,
759
- fixFlawsTypes : new Set ( fixFlawsTypes ) ,
760
- fixFlawsVerbose : true ,
761
- } ) ;
763
+ try {
764
+ if ( fileTypes . includes ( document . isMarkdown ? "md" : "html" ) ) {
765
+ await buildDocument ( document , {
766
+ fixFlaws : true ,
767
+ fixFlawsTypes : new Set ( fixFlawsTypes ) ,
768
+ fixFlawsVerbose : true ,
769
+ } ) ;
770
+ }
771
+ } catch ( e ) {
772
+ console . error ( e ) ;
762
773
}
774
+ progressBar . increment ( ) ;
763
775
}
776
+
777
+ progressBar . stop ( ) ;
764
778
} )
765
779
)
766
780
0 commit comments