mirror of
https://github.com/hauke68/Magallanes.git
synced 2026-09-04 08:28:57 +02:00
Proper exit code. Issue #52
This commit is contained in:
@@ -108,18 +108,20 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$exitCode = 1000;
|
||||
|
||||
// Check if Environment is not Locked
|
||||
$lockFile = getcwd() . '/.mage/' . $this->getConfig()->getEnvironment() . '.lock';
|
||||
if (file_exists($lockFile)) {
|
||||
Console::output('<red>This environment is locked!</red>', 1, 2);
|
||||
echo file_get_contents($lockFile);
|
||||
return;
|
||||
return 1010;
|
||||
}
|
||||
|
||||
// Check for running instance and Lock
|
||||
if (file_exists(getcwd() . '/.mage/~working.lock')) {
|
||||
Console::output('<red>There is already an instance of Magallanes running!</red>', 1, 2);
|
||||
return;
|
||||
return 1020;
|
||||
} else {
|
||||
touch(getcwd() . '/.mage/~working.lock');
|
||||
}
|
||||
@@ -193,6 +195,12 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
|
||||
if (file_exists(getcwd() . '/.mage/~working.lock')) {
|
||||
unlink(getcwd() . '/.mage/~working.lock');
|
||||
}
|
||||
|
||||
if (self::$failedTasks === 0) {
|
||||
$exitCode = 0;
|
||||
}
|
||||
|
||||
return $exitCode;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user