@@ -34,24 +34,24 @@ var argv = require('yargs')
3434 } )
3535 . argv
3636
37- function processing ( file , output ) {
37+ function processing ( file , output ) {
3838 // get htmls
3939 var html = fs . readFileSync ( file , 'utf8' )
40- var plugins ;
41- var fileConfig = argv . config && JSON . parse ( fs . readFileSync ( argv . config , 'utf-8' ) ) ;
40+ var plugins
41+ var fileConfig = argv . config && JSON . parse ( fs . readFileSync ( argv . config , 'utf-8' ) )
4242
4343 if ( argv . autoOff ) {
44- var use = argv . use ? argv . use : [ ] ;
45- var cfg = argv . config ? Object . keys ( fileConfig ) : [ ] ;
44+ var use = argv . use ? argv . use : [ ]
45+ var cfg = argv . config ? Object . keys ( fileConfig ) : [ ]
4646 plugins = [ ] . concat ( use , cfg ) . map ( ( plugin ) => {
4747 try {
48- return require ( plugin ) ( argv [ plugin ] )
48+ return require ( plugin ) ( argv [ plugin ] )
4949 } catch ( err ) {
50- if ( err . code === 'MODULE_NOT_FOUND' ) {
51- throw new TypeError ( 'Plugin Error: Cannot find module ' + plugin ) ;
52- }
50+ if ( err . code === 'MODULE_NOT_FOUND' ) {
51+ throw new TypeError ( 'Plugin Error: Cannot find module ' + plugin )
52+ }
5353 }
54- } ) ;
54+ } )
5555 } else {
5656 // config
5757 var config = { }
@@ -76,21 +76,21 @@ function processing(file, output) {
7676 } )
7777}
7878
79- function isFile ( outputPath ) {
79+ function isFile ( outputPath ) {
8080 if ( outputPath === undefined ) {
8181 return false
8282 }
8383 return Boolean ( path . extname ( outputPath ) )
8484}
8585
86- function getOutput ( file ) {
86+ function getOutput ( file ) {
8787 if ( argv . output === undefined ) {
8888 return file
8989 }
9090 return argv . output + path . basename ( file )
9191}
9292
93- function createFolder ( outputPath ) {
93+ function createFolder ( outputPath ) {
9494 if ( isFile ( outputPath ) === true ) {
9595 outputPath = path . dirname ( outputPath )
9696 }
0 commit comments