mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
Commands exist status
This commit is contained in:
@@ -60,6 +60,10 @@ class CheckFilePermissions implements Command
|
||||
|
||||
$msg = " " . ($isWritable ? "OK" : "FAIL") . " : $path";
|
||||
|
||||
if (!$isWritable) {
|
||||
$io->setExitStatus(1);
|
||||
}
|
||||
|
||||
$io->writeLine($msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,12 +55,14 @@ class Import implements Command
|
||||
if (!$id && $filePath) {
|
||||
if (!$paramsId) {
|
||||
$io->writeLine("You need to specify --params-id option.");
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->fileManager->isFile($filePath)) {
|
||||
$io->writeLine("File not found.");
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -77,6 +79,7 @@ class Import implements Command
|
||||
$countDuplicate = $result->getCountDuplicate();
|
||||
} catch (Throwable $e) {
|
||||
$io->writeLine("Error occurred: " . $e->getMessage());
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -98,6 +101,7 @@ class Import implements Command
|
||||
$this->service->revert($id);
|
||||
} catch (Throwable $e) {
|
||||
$io->writeLine("Error occurred: " . $e->getMessage());
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -114,6 +118,7 @@ class Import implements Command
|
||||
$result = $this->service->importById($id, true, $forceResume);
|
||||
} catch (Throwable $e) {
|
||||
$io->writeLine("Error occurred: " . $e->getMessage());
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -133,5 +138,6 @@ class Import implements Command
|
||||
}
|
||||
|
||||
$io->writeLine("Not enough params passed.");
|
||||
$io->setExitStatus(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ class AppInfo implements Command
|
||||
}
|
||||
|
||||
$io->writeLine("Not supported flag specified.");
|
||||
$io->setExitStatus(1);
|
||||
}
|
||||
|
||||
protected function processType(IO $io, string $type, Params $params): void
|
||||
|
||||
@@ -50,6 +50,7 @@ class EntityUtil implements Command
|
||||
|
||||
if (!$subCommand) {
|
||||
$io->writeLine("No sub-command specified.");
|
||||
$io->setExitStatus(1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user