Skip to content
Snippets Groups Projects
Commit 458fd9be authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #9305 TIME 0:10 return error in exec command

parent b8f5a648
No related branches found
No related tags found
No related merge requests found
...@@ -89,8 +89,8 @@ class VersionUpdateController ...@@ -89,8 +89,8 @@ class VersionUpdateController
} }
$output = []; $output = [];
$diff = exec('git diff', $output); $diff = exec('git diff 2>&1', $output);
$stagedDiff = exec('git diff --staged', $output); $stagedDiff = exec('git diff --staged 2>&1', $output);
return $response->withJson([ return $response->withJson([
'lastAvailableMinorVersion' => $lastAvailableMinorVersion, 'lastAvailableMinorVersion' => $lastAvailableMinorVersion,
...@@ -148,8 +148,8 @@ class VersionUpdateController ...@@ -148,8 +148,8 @@ class VersionUpdateController
$minorVersion = $availableMinorVersions[0]; $minorVersion = $availableMinorVersions[0];
$output = []; $output = [];
$diff = exec('git diff', $output); $diff = exec('git diff 2>&1', $output);
$stagedDiff = exec('git diff --staged', $output); $stagedDiff = exec('git diff --staged 2>&1', $output);
if (!empty($output) || !empty($diff) || !empty($stagedDiff)) { if (!empty($output) || !empty($diff) || !empty($stagedDiff)) {
return $response->withStatus(400)->withJson(['errors' => 'Some files are modified. Can not update application', 'lang' => 'canNotUpdateApplication']); return $response->withStatus(400)->withJson(['errors' => 'Some files are modified. Can not update application', 'lang' => 'canNotUpdateApplication']);
...@@ -157,7 +157,7 @@ class VersionUpdateController ...@@ -157,7 +157,7 @@ class VersionUpdateController
$output = []; $output = [];
exec('git fetch'); exec('git fetch');
exec("git checkout {$minorVersion}", $output); exec("git checkout {$minorVersion} 2>&1", $output);
$log = "Application updated from {$currentVersion} to {$minorVersion}\nCheckout response => " . implode(' ', $output) . "\n"; $log = "Application updated from {$currentVersion} to {$minorVersion}\nCheckout response => " . implode(' ', $output) . "\n";
file_put_contents('updateVersion.log', $log, FILE_APPEND); file_put_contents('updateVersion.log', $log, FILE_APPEND);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment