message: Update shrinkwrap file after dependencies are updated
diff: const ncu = require('npm-check-updates');
  +const { installAndRun, findRushJsonFolder, RUSH_JSON_FILENAME } = require("./install-run");
  const { readdirSync, existsSync } = require('fs');
  const { join } = require('path');
  @@ -32,6 +33,32 @@ async function updatePackageFiles() {
  return results.some((packageUpdated) => packageUpdated);
  }
  +function updateRushShrinkwrapFile() {
  +
  + // from install-run-rush.js
  + function getRushVersion() {
  + const rushJsonFolder = findRushJsonFolder();
  + const rushJsonPath = join(rushJsonFolder, RUSH_JSON_FILENAME);
  + try {
  + const rushJsonContents = fs.readFileSync(rushJsonPath, 'utf-8');
  + // Use a regular expression to parse out the rushVersion value because rush.json supports comments,
  + // but JSON.parse does not and we don't want to pull in more dependencies than we need to in this script.
  + const rushJsonMatches = rushJsonContents.match(/\"rushVersion\"\s*\:\s*\"([0-9a-zA-Z.+\-]+)\"/);
  + return rushJsonMatches[1];
  + }
  + catch (e) {
  + throw new Error(`Unable to determine the required version of Rush from rush.json (${rushJsonFolder}). ` +
  + 'The \'rushVersion\' field is either not assigned in rush.json or was specified ' +
  + 'using an unexpected syntax.');
  + }
  + }
  +
  + const statusCode = installAndRun('@microsoft/rush', getRushVersion(), 'rush', [ 'update', '--full' ]);
  + if (statusCode !== 0) {
  + throw new Error(`'rush update' exited with code ${code}`);
  + }
  +}
  +
  async function run() {
  const shouldUpdateShrinkwrapFile = await updatePackageFiles();
  if (!shouldUpdateShrinkwrapFile) {
  @@ -39,6 +66,7 @@ async function run() {
  return;
  }
  + updateRushShrinkwrapFile();
  console.info('Done!');
  }
  