function updateRepoDependencies()

in src/nightly.js [109:128]


function updateRepoDependencies (repo, dependencies) {
    const packageJSONPath = path.join(process.cwd(), 'package.json');
    const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));

    // Let's iterate through repos we're going to release
    // eslint-disable-next-line array-callback-return
    Object.keys(dependencies).map(function (dependencyId) {
        const repo = repoutil.getRepoById(dependencyId);
        const packageId = repo.packageName || repo.repoName;

        if (packageJSON.dependencies[packageId]) {
            // If current repo has dependency that points to one of packages, we're going
            // to release, update that dependency's version to nightly
            apputil.print('Updating ' + packageId + ' dependency version to ' + dependencies[dependencyId]);
            packageJSON.dependencies[packageId] = dependencies[dependencyId];
        }
    });

    fs.writeFileSync(packageJSONPath, JSON.stringify(packageJSON, null, 2) + '\n', 'utf8');
}