feat(updater): better num version + backup parameter bis
Some checks are pending
/ test (push) Waiting to run
Some checks are pending
/ test (push) Waiting to run
This commit is contained in:
parent
3020238f96
commit
107bd64253
1 changed files with 8 additions and 2 deletions
|
@ -39,6 +39,12 @@ if ($isRoot) {
|
|||
'description' => 'Update to latest version of stable yeswiki',
|
||||
'noValue' => true
|
||||
],
|
||||
'backup' => [
|
||||
'prefix' => 'b',
|
||||
'longPrefix' => 'backup',
|
||||
'description' => 'Save a backup in /root/yeswiki_backups folder before upgrading the yeswiki',
|
||||
'defaultValue' => true
|
||||
],
|
||||
'depth' => [
|
||||
'prefix' => 'd',
|
||||
'longPrefix' => 'depth',
|
||||
|
@ -60,6 +66,7 @@ if ($isRoot) {
|
|||
try {
|
||||
$update = $climate->arguments->get('update');
|
||||
$output = $climate->arguments->get('output');
|
||||
$backup = $climate->arguments->get('backup');
|
||||
$depth = $climate->arguments->get('depth');
|
||||
$matches = searchWikis($path, 'wakka.config.php', $depth);
|
||||
if (count($matches) == 0) {
|
||||
|
@ -87,11 +94,10 @@ if ($isRoot) {
|
|||
} elseif ($wiki['RELEASE'] == $version) {
|
||||
$climate->info('Skipping up-to-date wiki '.$wiki['URL']);
|
||||
} else {
|
||||
$climate->info(upgradeWiki($destDir, $wiki['PATH']));
|
||||
$climate->info(upgradeWiki($destDir, $wiki['PATH'], $backup));
|
||||
}
|
||||
}
|
||||
} else { // show yeswiki list info
|
||||
$climate->info(count($matches) . ' yeswikis found on ' . $path);
|
||||
switch ($output) {
|
||||
|
||||
case 'table':
|
||||
|
|
Loading…
Add table
Reference in a new issue