Files
boost-tasks/update-website-documentation

35 lines
916 B
PHP
Executable File

#!/usr/bin/env php
<?php
require_once(__DIR__.'/vendor/autoload.php');
use BoostTasks\TempDirectory;
// use BoostTasks\BinTrayCache;
use BoostTasks\ArtifactoryCache;
use BoostTasks\Documentation;
use BoostTasks\Settings;
use BoostTasks\CommandLineOptions;
use BoostTasks\Log;
// use RuntimeException;
function main() {
$options = CommandLineOptions::process($_SERVER['argv'],
'Update the website development documentation from BinTray.');
if (is_numeric($options)) { exit($options); }
Settings::init($options);
foreach(array('master', 'develop') as $branch) {
try {
// $cache = new BinTrayCache;
$cache = new ArtifactoryCache;
$file_details = $cache->fetchDetails($branch);
Documentation::install($cache, $file_details, $branch);
}
catch(RuntimeException $e) {
Log::error($e);
}
}
}
main();