Commands exist status

This commit is contained in:
Yurii
2026-06-26 11:11:16 +03:00
parent 8edd9da7a0
commit f757a76040
4 changed files with 12 additions and 0 deletions

View File

@@ -60,6 +60,10 @@ class CheckFilePermissions implements Command
$msg = " " . ($isWritable ? "OK" : "FAIL") . " : $path";
if (!$isWritable) {
$io->setExitStatus(1);
}
$io->writeLine($msg);
}
}

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -50,6 +50,7 @@ class EntityUtil implements Command
if (!$subCommand) {
$io->writeLine("No sub-command specified.");
$io->setExitStatus(1);
return;
}