@@ -23,9 +23,11 @@ const platform = os.platform();
23
23
24
24
/* eslint-disable no-console */
25
25
async function main ( ) {
26
- console . error ( 'Updating the cargo.toml version to match new version' ) ;
27
26
const projectRoot = path . join ( __dirname , '..' ) ;
28
27
const cargoTOMLPath = path . join ( projectRoot , 'Cargo.toml' ) ;
28
+ const cargoLockPath = path . join ( projectRoot , 'Cargo.lock' ) ;
29
+
30
+ console . error ( 'Updating the Cargo.toml version to match new version' ) ;
29
31
const cargoTOML = await fs . promises . readFile ( cargoTOMLPath , 'utf-8' ) ;
30
32
const cargoTOMLMatch = cargoTOML . match ( / v e r s i o n \s * = \s * " ( .* ) " / ) ;
31
33
const cargoTOMLUpdated = cargoTOML . replace (
@@ -34,25 +36,21 @@ async function main() {
34
36
) ;
35
37
await fs . promises . writeFile ( cargoTOMLPath , cargoTOMLUpdated , 'utf-8' ) ;
36
38
37
- console . error ( 'updating cargo lock file with change ' ) ;
39
+ console . error ( 'Updating the Cargo. lock version to match new version ' ) ;
38
40
childProcess . execFileSync ( 'cargo' , [ 'update' , '--package' , 'quic' ] , {
39
41
stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
40
42
windowsHide : true ,
41
43
encoding : 'utf-8' ,
42
44
shell : platform === 'win32' ? true : false ,
43
45
} ) ;
44
46
45
- console . error ( 'Staging changes in git' ) ;
46
- childProcess . execFileSync (
47
- 'git' ,
48
- [ 'add' , cargoTOMLPath , path . join ( projectRoot , 'Cargo.lock' ) ] ,
49
- {
50
- stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
51
- windowsHide : true ,
52
- encoding : 'utf-8' ,
53
- shell : platform === 'win32' ? true : false ,
54
- } ,
55
- ) ;
47
+ console . error ( 'Staging Cargo.toml and Cargo.lock' ) ;
48
+ childProcess . execFileSync ( 'git' , [ 'add' , cargoTOMLPath , cargoLockPath ] , {
49
+ stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
50
+ windowsHide : true ,
51
+ encoding : 'utf-8' ,
52
+ shell : platform === 'win32' ? true : false ,
53
+ } ) ;
56
54
57
55
console . error (
58
56
'Updating the package.json with optional native dependencies and package-lock.json' ,
0 commit comments