diff --git a/deploy.php b/deploy.php index 85f5bdc..2840d3f 100644 --- a/deploy.php +++ b/deploy.php @@ -29,7 +29,7 @@ function errorPage($msg) { } // Command to execute at the end of the script -function endScript() { +function endScript($errorMessage = "") { // Remove lock file unlink(__DIR__ . '/deploy.lock'); // Flush buffer and prepare output for log and email @@ -51,6 +51,7 @@ function endScript() { if(defined('LOG_FILE') && LOG_FILE !== '') error_log($output, 3, LOG_FILE); // Send email notification if(defined('EMAIL_NOTIFICATIONS') && EMAIL_NOTIFICATIONS !== '') error_log($output, 1, EMAIL_NOTIFICATIONS); + die($errorMessage); } /* Begin Script Execution */ @@ -70,7 +71,6 @@ function endScript() { } else { errorPage('
\n" . implode("\n", $err) . "\n"); endScript(); - die(); } // Check if lock file exists if (file_exists(__DIR__ . '/deploy.lock')) { errorPage('