@@ -21,7 +21,7 @@ class ChangeLogHelper {
21
21
}
22
22
23
23
async getAllReleaseVersionsFromGivenDate ( date ) {
24
- this . logger . debug ( `Started detecting the versions from the date: ${ date } ` ) ;
24
+ this . logger . info ( `Started detecting the versions from the date: ${ date } ` ) ;
25
25
const versions = [ ] ;
26
26
const readLine = await this . getReadLiner ( this . oaiChangelogFilename ) ;
27
27
for await ( const line of readLine ) {
@@ -36,38 +36,38 @@ class ChangeLogHelper {
36
36
}
37
37
}
38
38
}
39
- this . logger . debug ( `Detected Versions: ${ versions } ` ) ;
39
+ this . logger . info ( `Detected Versions: ${ versions } ` ) ;
40
40
return versions ;
41
41
}
42
42
43
43
async getLatestChangelogGeneratedDate ( ) {
44
- this . logger . debug ( 'Started detecting the latest date in cli core changelog' ) ;
44
+ this . logger . info ( 'Started detecting the latest date in cli core changelog' ) ;
45
45
let latestDate ;
46
46
const readLine = await this . getReadLiner ( this . cliCoreChangelogFilename ) ;
47
47
for await ( const line of readLine ) {
48
48
latestDate = this . dateRegex . exec ( line ) ;
49
49
if ( latestDate ) {
50
50
latestDate = latestDate [ 0 ] ;
51
- this . logger . debug ( `Detected the latest Date: ${ latestDate } ` ) ;
51
+ this . logger . info ( `Detected the latest Date: ${ latestDate } ` ) ;
52
52
break ;
53
53
}
54
54
}
55
55
return latestDate ;
56
56
}
57
57
58
58
async getChangesAfterGivenDate ( date ) {
59
- this . logger . debug ( `Started getting the changelog from given date: ${ date } ` ) ;
59
+ this . logger . info ( `Started getting the changelog from given date: ${ date } ` ) ;
60
60
let readLines = false ;
61
61
let fileData = '' ;
62
62
const readLine = await this . getReadLiner ( this . oaiChangelogFilename ) ;
63
63
for await ( const line of readLine ) {
64
64
const currentDate = this . dateRegex . exec ( line ) ;
65
65
if ( currentDate ) {
66
66
if ( currentDate [ 0 ] > date ) {
67
- this . logger . debug ( 'Reading the lines' ) ;
67
+ this . logger . info ( 'Reading the lines' ) ;
68
68
readLines = true ;
69
69
} else {
70
- this . logger . debug ( `Changes from OpenAPI specs: ${ fileData } ` ) ;
70
+ this . logger . info ( `Changes from OpenAPI specs: ${ fileData } ` ) ;
71
71
break ;
72
72
}
73
73
} else if ( readLines ) {
@@ -78,13 +78,13 @@ class ChangeLogHelper {
78
78
}
79
79
80
80
async getAndAppendChangesToChangelog ( ) {
81
- this . logger . debug ( 'Started getAndAppendChangesToChangelog' ) ;
81
+ this . logger . info ( 'Started getAndAppendChangesToChangelog' ) ;
82
82
const latestDate = await this . getLatestChangelogGeneratedDate ( ) ; // changes.md
83
83
if ( latestDate ) {
84
84
const changeLog = await this . getChangesAfterGivenDate ( latestDate ) ; // oai_changes.md
85
85
if ( changeLog ) {
86
86
try {
87
- this . logger . debug ( 'Updating the CHANGES.md' ) ;
87
+ this . logger . info ( 'Updating the CHANGES.md' ) ;
88
88
const data = fs . readFileSync ( this . cliCoreChangelogFilename ) ;
89
89
const fd = fs . openSync ( this . cliCoreChangelogFilename , 'w+' ) ;
90
90
const insert = Buffer . from ( changeLog ) ;
@@ -93,6 +93,7 @@ class ChangeLogHelper {
93
93
fs . close ( fd , ( err ) => {
94
94
if ( err ) throw err ;
95
95
} ) ;
96
+ fs . writeFileSync ( 'changeLog.md' , changeLog ) ;
96
97
} catch ( error ) {
97
98
this . logger . error ( `Error while updating the changelog: ${ error } ` ) ;
98
99
}
0 commit comments