message: Push updated dependencies to a new git branch
diff: @@ -2,10 +2,25 @@ const ncu = require('npm-check-updates');
  const { installAndRun, findRushJsonFolder, RUSH_JSON_FILENAME } = require("./install-run");
  const { readdirSync, existsSync } = require('fs');
  const { join } = require('path');
  +const { spawnSync } = require('child_process');
  +const BRANCH_NAME = 'update-npm-dependencies';
  +const COMMIT_MESSAGE = 'Update npm dependencies';
  const IGNORED_PACKAGES = [
  '@types/node'
  -]
  +];
  +
  +function shellExec(command, args) {
  + const commandString = `${command} ${args.join(' ')}`;
  + console.log(commandString);
  + const { status } = spawnSync(command, args, {
  + stdio: 'inherit'
  + });
  +
  + if (status !== 0) {
  + throw new Error(`'${commandString}' exited with code ${status}`);
  + }
  +}
  async function updatePackageFiles() {
  const allPackageFiles = readdirSync(process.cwd(), { withFileTypes: true })
  @@ -59,6 +74,12 @@ function updateRushShrinkwrapFile() {
  }
  }
  +async function pushChanges() {
  + await shellExec('git', [ 'checkout', '-b', BRANCH_NAME ]);
  + await shellExec('git', [ 'commit', '-a', '-m', COMMIT_MESSAGE ]);
  + await shellExec('git', [ 'push', '--set-upstream', 'origin', BRANCH_NAME ]);
  +}
  +
  async function run() {
  const shouldUpdateShrinkwrapFile = await updatePackageFiles();
  if (!shouldUpdateShrinkwrapFile) {
  @@ -67,6 +88,9 @@ async function run() {
  }
  updateRushShrinkwrapFile();
  +
  + await pushChanges();
  +
  console.info('Done!');
  }
  