@@ -10,43 +10,43 @@ export abstract class BaseMakeCommand extends BaseCommand {
10
10
11
11
abstract getStub ( ) ;
12
12
13
- public getContent ( ) {
13
+ public getContent ( ) : void {
14
14
this . content = readFileSync ( this . getStub ( ) ) . toString ( ) ;
15
15
}
16
16
17
- public replaceContent ( contents : { search : string ; value : string } [ ] ) {
18
- for ( let content of contents ) {
19
- let regex = new RegExp ( escapeRegExp ( content . search ) , 'g' ) ;
17
+ public replaceContent ( contents : { search : string ; value : string } [ ] ) : void {
18
+ for ( const content of contents ) {
19
+ const regex = new RegExp ( escapeRegExp ( content . search ) , 'g' ) ;
20
20
this . content = this . content . replace ( regex , content . value ) ;
21
21
}
22
22
}
23
23
24
- public writeFile ( pathName , fileName ) {
24
+ public writeFile ( pathName : string , fileName : string ) : void {
25
25
writeFileSync ( path . join ( process . cwd ( ) , pathName , fileName ) , this . content ) ;
26
26
}
27
27
28
- public writeFileToModule ( pathName , fileName ) {
29
- let fullPath = this . getModulePath ( pathName ) ;
28
+ public writeFileToModule ( pathName : string , fileName : string ) : void {
29
+ const fullPath = this . getModulePath ( pathName ) ;
30
30
mkdirSync ( fullPath , { recursive : true } ) ;
31
31
this . writeFile ( fullPath , fileName ) ;
32
32
}
33
33
34
- public getModulePath ( pathName ) {
34
+ public getModulePath ( pathName : string ) : string {
35
35
if ( this . opts . module ) {
36
36
return path . join ( 'src' , this . opts . module , pathName ) ;
37
37
}
38
38
return path . join ( 'src' , pathName ) ;
39
39
}
40
40
41
- public get args ( ) {
41
+ public get args ( ) : string [ ] {
42
42
return this . customArgs || this . program . args ;
43
43
}
44
44
45
- public get opts ( ) {
45
+ public get opts ( ) : object & { module ?: string } {
46
46
return this . customOptions || this . program . opts ( ) ;
47
47
}
48
48
49
- public runWith ( args : any [ ] = undefined , opts : any = undefined ) {
49
+ public runWith ( args : object = undefined , opts : object = undefined ) : void {
50
50
this . customArgs = args ;
51
51
this . customOptions = opts ;
52
52
return this . handle ( ) ;
0 commit comments