Skip to content
Snippets Groups Projects
Verified Commit cf43701a authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #9305 TIME 0:10 chang exec for file diff

parent 35ea0718
No related branches found
No related tags found
No related merge requests found
......@@ -89,9 +89,9 @@ class VersionUpdateController
}
$output = [];
exec('git diff 2>&1', $output);
exec('git diff --staged 2>&1', $output);
exec('git status --porcelain --untracked-files=no 2>&1', $output);
return $response->withJson([
'lastAvailableMinorVersion' => $lastAvailableMinorVersion,
'lastAvailableMajorVersion' => $lastAvailableMajorVersion,
......@@ -149,10 +149,9 @@ class VersionUpdateController
$minorVersion = $availableMinorVersions[0];
$output = [];
$diff = exec('git diff 2>&1', $output);
$stagedDiff = exec('git diff --staged 2>&1', $output);
exec('git status --porcelain --untracked-files=no 2>&1', $output);
if (!empty($output) || !empty($diff) || !empty($stagedDiff)) {
if (!empty($output)) {
return $response->withStatus(400)->withJson(['errors' => 'Some files are modified. Can not update application', 'lang' => 'canNotUpdateApplication']);
}
......
......@@ -31,7 +31,7 @@
</span>
<mat-icon class="fa fa-info-circle fa-2x" style="flex: 1;text-align: right;"></mat-icon>
</div>
<div class="alert-message alert-message-danger" *ngIf="!versions.canUpdate && versions.lastAvailableMinorVersion!=null" [innerHTML]="versions.diffOutput">
<div class="alert-message alert-message-danger" *ngIf="!versions.canUpdate && versions.lastAvailableMinorVersion!=null" [innerHTML]="lang.updateWarn + versions.diffOutput.join('<br/>')">
</div>
<div class="col-sm-12" style="text-align:center;" *ngIf="versions.lastAvailableMinorVersion!=null">
<button mat-raised-button color="primary" [disabled]="!versions.canUpdate"
......
......@@ -1030,4 +1030,5 @@ export const LANG_EN = {
"updateInProgress" : "Update in progress ...",
"updateInfo" : "This action cannot be undone! Do not make any actions during process.",
"isAvailable" : "is available",
"updateWarn" : "Update is not possible.<br/>These files can be modified : <br/>"
};
......@@ -1063,4 +1063,5 @@ export const LANG_FR = {
"updateInProgress" : "Mise à jour en cours ...",
"updateInfo" : "Cette action est irréversible ! Il est préférable de ne pas faire d'actions durant le processus et qu'aucun utilisateur ne soit connecté.",
"isAvailable" : "est disponible",
"updateWarn" : "<b>Impossible</b> d'effectuer la mise à jour. Voici les fichiers pouvant être mise en cause :<br/><br/>"
};
\ No newline at end of file
......@@ -1056,4 +1056,5 @@ export const LANG_NL = {
"updateInProgress" : "Update in progress ...", //_TO_TRANSLATE
"updateInfo" : "This action cannot be undone! Do not make any actions during process.", //_TO_TRANSLATE
"isAvailable" : "is available", //_TO_TRANSLATE
"updateWarn" : "Update is not possible.<br/>These files can be modified : <br/>"
};
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