fix(updater) : better error catching
This commit is contained in:
parent
7ebc4c0c1a
commit
0cb608e80b
1 changed files with 9 additions and 2 deletions
|
@ -23,7 +23,6 @@ if (0 == posix_getuid()) {
|
||||||
'longPrefix' => 'path',
|
'longPrefix' => 'path',
|
||||||
'description' => 'Path to scan for wikis',
|
'description' => 'Path to scan for wikis',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'defaultValue' => '/var/www/html'
|
|
||||||
],
|
],
|
||||||
'output' => [
|
'output' => [
|
||||||
'prefix' => 'o',
|
'prefix' => 'o',
|
||||||
|
@ -38,7 +37,15 @@ if (0 == posix_getuid()) {
|
||||||
'defaultValue' => '0'
|
'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');
|
$path = $climate->arguments->get('path');
|
||||||
if (!empty($path) && is_dir($path)) {
|
if (!empty($path) && is_dir($path)) {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue