File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change
1
+ const { EOL } = require ( "os" ) ;
1
2
const { env } = require ( "process" ) ;
2
3
const { replaceInFile } = require ( "replace-in-file" ) ;
3
4
4
- const config = {
5
+ const versionFilesOption = {
5
6
files : [ "robotcode/_version.py" , "pyproject.toml" ] ,
6
7
from : / ( ^ _ * v e r s i o n _ * \s * = \s * [ ' " ] ) ( [ ^ ' " ] * ) ( [ ' " ] ) / gm,
7
8
to : "$1" + env . npm_package_version + "$3" ,
8
9
} ;
9
- replaceInFile ( config , function ( error , results ) {
10
+ replaceInFile ( versionFilesOption , function ( error , _results ) {
10
11
if ( error ) {
11
12
console . error ( error ) ;
12
13
}
13
- if ( results ) {
14
- for ( const result of results ) {
15
- console . log ( `${ result . file } has ${ result . hasChanged ? "" : "not " } changed` ) ;
16
- }
14
+ } ) ;
15
+
16
+ const changelogOptions = {
17
+ files : [ "CHANGELOG.md" ] ,
18
+ from : / ^ ( \# * \s * ) ( \[ U n r e l e a s e d \] ) $ / gm,
19
+ to : "$1$2" + EOL + EOL + "$1 " + env . npm_package_version ,
20
+ } ;
21
+ replaceInFile ( changelogOptions , function ( error , _results ) {
22
+ if ( error ) {
23
+ console . error ( error ) ;
17
24
}
18
25
} ) ;
You can’t perform that action at this time.
0 commit comments