@@ -34,24 +34,24 @@ var argv = require('yargs')
34
34
} )
35
35
. argv
36
36
37
- function processing ( file , output ) {
37
+ function processing ( file , output ) {
38
38
// get htmls
39
39
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' ) )
42
42
43
43
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 ) : [ ]
46
46
plugins = [ ] . concat ( use , cfg ) . map ( ( plugin ) => {
47
47
try {
48
- return require ( plugin ) ( argv [ plugin ] )
48
+ return require ( plugin ) ( argv [ plugin ] )
49
49
} 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
+ }
53
53
}
54
- } ) ;
54
+ } )
55
55
} else {
56
56
// config
57
57
var config = { }
@@ -76,21 +76,21 @@ function processing(file, output) {
76
76
} )
77
77
}
78
78
79
- function isFile ( outputPath ) {
79
+ function isFile ( outputPath ) {
80
80
if ( outputPath === undefined ) {
81
81
return false
82
82
}
83
83
return Boolean ( path . extname ( outputPath ) )
84
84
}
85
85
86
- function getOutput ( file ) {
86
+ function getOutput ( file ) {
87
87
if ( argv . output === undefined ) {
88
88
return file
89
89
}
90
90
return argv . output + path . basename ( file )
91
91
}
92
92
93
- function createFolder ( outputPath ) {
93
+ function createFolder ( outputPath ) {
94
94
if ( isFile ( outputPath ) === true ) {
95
95
outputPath = path . dirname ( outputPath )
96
96
}
0 commit comments