@@ -23,9 +23,11 @@ const platform = os.platform();
2323
2424/* eslint-disable no-console */
2525async function main ( ) {
26- console . error ( 'Updating the cargo.toml version to match new version' ) ;
2726 const projectRoot = path . join ( __dirname , '..' ) ;
2827 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' ) ;
2931 const cargoTOML = await fs . promises . readFile ( cargoTOMLPath , 'utf-8' ) ;
3032 const cargoTOMLMatch = cargoTOML . match ( / v e r s i o n \s * = \s * " ( .* ) " / ) ;
3133 const cargoTOMLUpdated = cargoTOML . replace (
@@ -34,25 +36,21 @@ async function main() {
3436 ) ;
3537 await fs . promises . writeFile ( cargoTOMLPath , cargoTOMLUpdated , 'utf-8' ) ;
3638
37- console . error ( 'updating cargo lock file with change ' ) ;
39+ console . error ( 'Updating the Cargo. lock version to match new version ' ) ;
3840 childProcess . execFileSync ( 'cargo' , [ 'update' , '--package' , 'quic' ] , {
3941 stdio : [ 'inherit' , 'inherit' , 'inherit' ] ,
4042 windowsHide : true ,
4143 encoding : 'utf-8' ,
4244 shell : platform === 'win32' ? true : false ,
4345 } ) ;
4446
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+ } ) ;
5654
5755 console . error (
5856 'Updating the package.json with optional native dependencies and package-lock.json' ,
0 commit comments