fix(updater) : better error catching

This commit is contained in:
Florian Schmitt 2024-01-09 16:17:21 +03:00
parent 7ebc4c0c1a
commit 0cb608e80b

View file

@ -23,7 +23,6 @@ if (0 == posix_getuid()) {
'longPrefix' => 'path',
'description' => 'Path to scan for wikis',
'required' => true,
'defaultValue' => '/var/www/html'
],
'output' => [
'prefix' => 'o',
@ -38,7 +37,15 @@ if (0 == posix_getuid()) {
'defaultValue' => '0'
],
]);
$climate->arguments->parse();
try {
$climate->arguments->parse();
} catch (\Throwable $th) {
if (!$climate->arguments->defined('path')) {
$climate->error('This command needs a valid path argument for example : -p /var/www/html');
$climate->usage();
return;
}
}
$path = $climate->arguments->get('path');
if (!empty($path) && is_dir($path)) {
try {