Update all packages to latest version

@param {string} file
516839
async function updateVersion(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { packageName } = config;

  const packageInfoFile = `${PACKAGES_PATH}/${packageName}/package.json`;
  const { default: packageInfo } = await import(packageInfoFile);

  if (info.version !== packageInfo.version) {
    const newPackageInfo = {
      ...packageInfo,
      version: info.version,
    };

    writeFileAsync(packageInfoFile, JSON.stringify(newPackageInfo, null, '  '))
      .then(
        () => console.log(`Updated ${packageName} to ${info.version}`),
        error => console.log(error),
      );
  }
}
1052222
function(callback) {
    async.waterfall([
      // 1. Resolve loose package versions.
      function(done) {
        var master = this.master;
        var packageToVersions = this.packageToVersions;
        Package.versions(master, packageToVersions, function(err, result) {
          this.packageToVersions = result;
          done(err, result);
        }.bind(this));
      }.bind(this),

      // 2. Dependency search.
      this.dependencySearch.bind(this),

      // 3. Make sure we have package and package version dirs.
      this.makedirs.bind(this),

      // 4. Download the world.
      this.download.bind(this),

      // 5. Commit the downloads to our package repository.
      this.commit.bind(this)
    ], callback);
  }
22777
function bumpTask(complete) {
  util.log('Current version:', util.colors.cyan(pkg.version));
  var choices = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'].map(function(versionType) {
    return versionType + ' (v' + semver.inc(pkg.version, versionType) + ')';
  });
  inquirer.prompt({
    type: 'list',
    name: 'version',
    message: 'What version update would you like?',
    choices: choices
  }).then(function(res) {
    var increment = res.version.split(' ')[0],
      newVersion = semver.inc(pkg.version, increment);

    // Set the new versions into the package object
    pkg.version = newVersion;

    // Write these to their own files, then build the output
    fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));

    complete();
  });
}
559229
async function buildConfig(file) {
  const { default: config } = await import(`${CONFIGS_PATH}/${file}`);
  const { creator, name, packageName } = config;

  creator
    .then((data) => {
      const stringifiedData = JSON.stringify(data);
      const generatedData = TEMPLATE.replace(/{{ data }}/, stringifiedData);
      const packageFile = path.resolve(PACKAGES_PATH, packageName, 'index.js');
      fs.writeFileSync(packageFile, generatedData);
    })
    .then(
      () => console.log(`Finished building ${name} config to ./packages/${packageName}`),
      error => console.log(error),
    );
}
707511
function bump_version(cb) {
    gulp.src('./package.json')
        .pipe(bump({
            type: 'patch'
        }))
        .pipe(gulp.dest('./'));
    console.log('Version Bumped');
    cb();
}
148975
function update(latest) {
    if (latest === null || latest === undefined) {
      isGap = true
      return
    }

    if (offset >= latest) {
      return
    }

    if (isGap) {
      gaps.push({start: offset, end: latest})
      isGap = false
    }

    offset = latest
  }
1184106
function (file) {
  let port = program.port,
    host = program.host || '127.0.0.1',
    dbname = program.dbname || '-deployd',
    mongoPort = program.mongoPort ? Number(program.mongoPort) : '27017',
    env = program.environment || process.env.DPD_ENV || 'development',
    retries = 0,
    credentials = {};


  if (!port) {
    port = 2403;
    retries = env === 'development' && 5;
  }

  if (file) {
    process.chdir(path.dirname(file));
  }
  if (test('-f', 'app.dpd')) {
    console.log(`deployd CLI version ${packageInfo.version}`);
    console.log('starting deployd');

    if (fs.existsSync(latestversionFile)) {
      const latest = fs.readFileSync(latestversionFile, 'utf-8');
      if (latest && semver.gt(latest, packageInfo.version)) {
        console.log(`deployd CLI v${latest} is available.`);
        console.log();
      }
    }
    checkForUpdates();

    if (!test('-d', './.dpd')) mkdir('-p', './.dpd');
    if (!test('-d', './.dpd/pids')) mkdir('-p', './.dpd/pids');
    if (!test('-d', './data')) mkdir('-p', './data');

    if (program.auth && program.host === undefined) {
      console.error("Authentication requires the '-h' host flag... exiting.");
      process.exit();
    }

    function setCredentials(username, password) { // eslint-disable-line no-inner-declarations
      Step(function () {
        const next = this;
        if (username && username !== '') {
          credentials.username = username;
          next();
        } else {
          console.error('Username cannot be blank.');
          process.exit();
        }
      },
        function () {
          const next = this;
          if (password && password !== '') {
            credentials.password = password;
            next();
          } else {
            console.error('Password cannot be blank.');
            process.exit();
          }
        },
        startup
      );
    }

    if (program.host) {
      if (program.auth) {
        const auth = program.auth.split(':'),
          username = auth[0],
          password = auth[1];
        setCredentials(username, password);
      } else if (program.username || program.password) {
        setCredentials(program.username, program.password);
      } else {
        startup();
      }
    } else {
      mongod.restart(program.mongod || 'mongod', env, mongoPort, startup);
    }
  } else {
    console.log('This directory does not contain a Deployd app!');
    console.log('Use "dpd create <appname>" to create a new app');
    console.log('or use "dpd path/to/app.dpd" to start an app in another directory');
    stop(1);
  }

  function startup(err) {
    if (err) {
      console.log("Failed to start MongoDB (Make sure 'mongod' are in your $PATH or use dpd --mongod option. Ref: http://docs.deployd.com/docs/basics/cli.html)");
      return stop(1);
    }

    const options = { port, env: 'development', db: { host, port: mongoPort, name: dbname } };

    options.env = program.environment || process.env.DPD_ENV || options.env;
    if (options.env !== 'development') console.log('starting in %s mode', options.env);

    if (credentials && credentials.length > 0) options.db.credentials = credentials;

    let dpd = createServer(options);
    dpd.on('listening', onListening);
    dpd.on('error', onError);
    dpd.listen();
    dpd.deploydPath = program.deploydPath;

    function onListening() {
      console.info('listening on port', options.port);
      const commands = repl(dpd);
      if (program.dashboard) {
        commands.dashboard();
      } else if (program.open) {
        commands.open();
      }
    }

    function onError(err2) {
      if (err2.code === 'EADDRINUSE') {
        console.error();
        console.error(`ERROR: port ${options.port} is already in use`);
        if (retries > 0) {
          options.port += 1;
          console.log(`Trying again on port ${options.port}...`);
          console.log();
          retries -= 1;
          dpd = createServer(options);
          dpd.on('listening', onListening);
          dpd.on('error', onError);
          dpd.listen();
        } else {
          process.exit();
        }
      } else {
        console.error(err2);
        process.exit();
      }
    }
  }
}
390645
function updateFileData(filePath, newRelPath, oldRelPath, data) {
    return new Promise(async(res, rej) => {
        let file = editLinks(data, newRelPath, oldRelPath);
        try {
            await writeFile(filePath, file);
            res();
        } catch (err) {
            rej();
        }
    })
}
1079662
function saveNewVersion(version, versionFile) {
    fs.writeFileSync(versionFile, JSON.stringify({
        version
    }, null, 2), 'UTF-8');
}
777245
function updateVersion(file, content, version) {
    const prev = /id="branch-cordova-sdk"[\s]*version="\d+\.\d+\.\d+"/gim;
    const next = `id="branch-cordova-sdk"\n  version="${version}"`;

    try {
      if (isFileXml(file)) {
        content = content.replace(prev, next);
      } else {
        isChange = content.version !== version;
        content.version = version;
      }
    } catch (e) {
      throw new Error(
        `BRANCH SDK: update to update npm version with file ${file}`
      );
    }
    return content;
  }
1045868
function update(args, done) {
    app = this.fractal;

    let typo3cli = path.join(typo3path, '../vendor/bin/typo3');
    let typo3args = ['extbase', 'component:discover'];
    try {
        if (fs.statSync(typo3cli).isFile()) {
            typo3args.shift();
        }
    } catch (e) {
        typo3cli = path.join(typo3path, 'typo3/cli_dispatch.phpsh');
    }

    try {
        if (fs.statSync(typo3cli).isFile()) {
            typo3args.unshift(typo3cli);
            const componentsJSON = execFileSync('php', typo3args).toString();
            const components = JSON.parse(componentsJSON);
            for (const component of components) {
                processComponent(component);
            }

            // Write the general shared context
            const context = { context: { typo3: typo3url } };
            writeFile(path.resolve(app.components.get('path'), 'components.config.json'), JSON.stringify(context, null, 4));

            // See if there's a component file manifest
            const manifest = path.resolve(app.components.get('path'), 'components.files.json');
            try {
                if (fs.statSync(manifest).isFile()) {
                    const currentFiles = new Set(files);
                    const prevFiles = new Set(JSON.parse(fs.readFileSync(manifest)));

                    // Delete all redundant files
                    [...prevFiles].filter(f => !currentFiles.has(f)).forEach(f => fs.unlinkSync(path.resolve(app.components.get('path'), f)));
                }
            } catch (e) {
                // Ignore errors
            } finally {
                writeFile(manifest, JSON.stringify(files));
                deleteEmpty.sync(app.components.get('path'));
            }
        }
        done();
    } catch (e) {
        console.log(e);
        process.exit(1);
    }
}
340821
function version() {
  const packageJson = require(path.resolve(__dirname, '..', 'package.json'));
  logger.info('@blackbaud/skyux-builder: %s', packageJson.version);
}
832243
def update(self, quiet=False, prefix='[polyglot_data] '):
    
    self.clear_status_cache()
    for pkg in self.packages():
      if self.status(pkg) == self.STALE:
        self.download(pkg, quiet=quiet, prefix=prefix)
927890
function updateNpmVersion(pluginConfig, config, callback) {
    const files = readFilePaths(FILES);
    const version = config.nextRelease.version;
    let git = "";

    for (let i = 0; i < files.length; i++) {
      // update
      const file = files[i];
      const content = readContent(file);
      const updated = updateVersion(file, content, version);

      // save
      git += `git add ${file} && `;
      saveContent(file, updated);
    }
    // publish
    isChange && commitChanges(git, version);
  }
14110
def update(
    ctx,
    state,
    bare=False,
    dry_run=None,
    outdated=False,
    **kwargs
):
    """"""
    from ..core import (
        ensure_project,
        do_outdated,
        do_lock,
        do_sync,
        project,
    )

    ensure_project(three=state.three, python=state.python, warn=True, pypi_mirror=state.pypi_mirror)
    if not outdated:
        outdated = bool(dry_run)
    if outdated:
        do_outdated(pypi_mirror=state.pypi_mirror)
    packages = [p for p in state.installstate.packages if p]
    editable = [p for p in state.installstate.editables if p]
    if not packages:
        echo(
            "{0} {1} {2} {3}{4}".format(
                crayons.white("Running", bold=True),
                crayons.red("$ pipenv lock", bold=True),
                crayons.white("then", bold=True),
                crayons.red("$ pipenv sync", bold=True),
                crayons.white(".", bold=True),
            )
        )
    else:
        for package in packages + editable:
            if package not in project.all_packages:
                echo(
                    "{0}: {1} was not found in your Pipfile! Aborting."
                    "".format(
                        crayons.red("Warning", bold=True),
                        crayons.green(package, bold=True),
                    ),
                    err=True,
                )
                ctx.abort()

    do_lock(
        clear=state.clear,
        pre=state.installstate.pre,
        keep_outdated=state.installstate.keep_outdated,
        pypi_mirror=state.pypi_mirror,
    )
    do_sync(
        ctx=ctx,
        dev=state.installstate.dev,
        three=state.three,
        python=state.python,
        bare=bare,
        dont_upgrade=not state.installstate.keep_outdated,
        user=False,
        clear=state.clear,
        unused=False,
        sequential=state.installstate.sequential,
        pypi_mirror=state.pypi_mirror,
    )
199197
def update_version_in_files(current_version: str, new_version: str, files: list):
    
    for filepath in files:
        # Read in the file
        with open(filepath, "r") as file:
            filedata = file.read()

        # Replace the target string
        filedata = filedata.replace(current_version, new_version)

        # Write the file out again
        with open(filepath, "w") as file:
            file.write(filedata)
951122
function getUpdatedEmittedFiles(emittedFiles, webpackRuntimeFiles) {
    let fallbackFiles = [];
    let hotHash;
    if (emittedFiles.some(x => x.endsWith('.hot-update.json'))) {
        let result = emittedFiles.slice();
        const hotUpdateScripts = emittedFiles.filter(x => x.endsWith('.hot-update.js'));
        hotUpdateScripts.forEach(hotUpdateScript => {
            const { name, hash } = parseHotUpdateChunkName(hotUpdateScript);
            hotHash = hash;
            // remove bundle/vendor.js files if there's a bundle.XXX.hot-update.js or vendor.XXX.hot-update.js
            result = result.filter(file => file !== `${name}.js`);
            if (webpackRuntimeFiles && webpackRuntimeFiles.length) {
                // remove files containing only the Webpack runtime (e.g. runtime.js)
                result = result.filter(file => webpackRuntimeFiles.indexOf(file) === -1);
            }
        });
        //if applying of hot update fails, we must fallback to the full files
        fallbackFiles = emittedFiles.filter(file => result.indexOf(file) === -1);
        return { emittedFiles: result, fallbackFiles, hash: hotHash };
    }
    else {
        return { emittedFiles, fallbackFiles };
    }
}