Fix: exit code when upgrade is ran from command line

This commit is contained in:
Laurent Destailleur
2012-08-05 00:46:10 +02:00
parent 17c45208d3
commit be4960cfbb
2 changed files with 9 additions and 2 deletions

View File

@@ -351,10 +351,14 @@ if (empty($actiondone))
print '<div class="error">'.$langs->trans("ErrorWrongParameters").'</div>';
}
$ret=0;
if (! $ok && isset($argv[1])) $ret=1;
dol_syslog("Exit ".$ret);
pFooter(! $ok && empty($_GET["ignoreerrors"]),$setuplang);
if ($db->connected) $db->close();
// Return code if ran from command line
if (! $ok && isset($argv[1])) exit(1);
if ($ret) exit($ret);
?>

View File

@@ -341,13 +341,16 @@ else
$error++;
}
$ret=0;
if ($error && isset($argv[1])) $ret=1;
dol_syslog("Exit ".$ret);
pFooter($error,$setuplang);
if ($db->connected) $db->close();
// Return code if ran from command line
if ($error && isset($argv[1])) exit(1);
if ($ret) exit($ret);