Skip to content

Commit

Permalink
chore: updated console.error in scripts/version.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed May 24, 2023
1 parent 48c85d0 commit d09fbb1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 17 deletions.
40 changes: 36 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 11 additions & 13 deletions scripts/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ const platform = os.platform();

/* eslint-disable no-console */
async function main() {
console.error('Updating the cargo.toml version to match new version');
const projectRoot = path.join(__dirname, '..');
const cargoTOMLPath = path.join(projectRoot, 'Cargo.toml');
const cargoLockPath = path.join(projectRoot, 'Cargo.lock');

console.error('Updating the Cargo.toml version to match new version');
const cargoTOML = await fs.promises.readFile(cargoTOMLPath, 'utf-8');
const cargoTOMLMatch = cargoTOML.match(/version\s*=\s*"(.*)"/);
const cargoTOMLUpdated = cargoTOML.replace(
Expand All @@ -34,25 +36,21 @@ async function main() {
);
await fs.promises.writeFile(cargoTOMLPath, cargoTOMLUpdated, 'utf-8');

console.error('updating cargo lock file with change');
console.error('Updating the Cargo.lock version to match new version');
childProcess.execFileSync('cargo', ['update', '--package', 'quic'], {
stdio: ['inherit', 'inherit', 'inherit'],
windowsHide: true,
encoding: 'utf-8',
shell: platform === 'win32' ? true : false,
});

console.error('Staging changes in git');
childProcess.execFileSync(
'git',
['add', cargoTOMLPath, path.join(projectRoot, 'Cargo.lock')],
{
stdio: ['inherit', 'inherit', 'inherit'],
windowsHide: true,
encoding: 'utf-8',
shell: platform === 'win32' ? true : false,
},
);
console.error('Staging Cargo.toml and Cargo.lock');
childProcess.execFileSync('git', ['add', cargoTOMLPath, cargoLockPath], {
stdio: ['inherit', 'inherit', 'inherit'],
windowsHide: true,
encoding: 'utf-8',
shell: platform === 'win32' ? true : false,
});

console.error(
'Updating the package.json with optional native dependencies and package-lock.json',
Expand Down

0 comments on commit d09fbb1

Please sign in to comment.