#!/usr/bin/env php add('version:', "Version of update (e.g. develop, 1.57.0)"); $options = CommandLineOptions::process($args, 'Update the documentation list', $specs); if (is_numeric($options)) { exit($options); } Settings::init($options); // TODO: For some reason 'hasArgument' is always true, even when // there isn't a version. Am I misunderstanding it? Doesn't really // matter as it ends up falsey. $version = array_key_exists('version', $options) ? $options['version'] : null; // Update the mirror GitHubEvents::downloadEvents(); $mirror = new LocalMirror(); $mirror->refresh(); $mirror->fetchDirty(); // Rebuild the in progress release notes $website_repo = new WebsiteRepo(); $result = $website_repo->updateInProgressReleaseNotes(); if (!$result) { // Don't want a hard failure because of a syntax error in the release // notes. echo "Rebuilding the in progress release notes failed.\n"; } // Update the website repo. $website_repo = new WebsiteRepo(); $result = $website_repo->updateDocumentationList($mirror, $version); if (!$result) { // Want a hard failure here, so that we're not updating the // super projects from data that isn't checked in. throw new RuntimeException("Failed to update documentation list on website."); } // Update maintainer lists. foreach (Settings::branchRepos() as $x) { $website_repo->updateSuperProject(new SuperProject($x)); } } main($_SERVER['argv']);