mirror of
https://github.com/boostorg/boost-tasks.git
synced 2026-01-30 19:52:11 +00:00
31 lines
735 B
PHP
Executable File
31 lines
735 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
require_once(__DIR__.'/vendor/autoload.php');
|
|
|
|
use GetOptionKit\OptionCollection;
|
|
|
|
function main($args) {
|
|
$specs = new OptionCollection;
|
|
$specs->add('no-fetch', "Don't fetch events from GitHub")
|
|
->defaultValue(false);
|
|
$specs->add('all', "Update all repos in mirror")
|
|
->defaultValue(false);
|
|
$options = CommandLineOptions::process($args,
|
|
'Creates or updates the GitHub mirror',
|
|
$specs);
|
|
|
|
if (!$options['no-fetch']) {
|
|
GitHubEventQueue::downloadEvents();
|
|
}
|
|
|
|
$mirror = new LocalMirror();
|
|
if ($options['all']) {
|
|
$mirror->refreshAll();
|
|
} else {
|
|
$mirror->refresh();
|
|
}
|
|
$mirror->fetchDirty();
|
|
}
|
|
|
|
main($_SERVER['argv']);
|