fixed file mirror check

This commit is contained in:
denisdulici 2019-12-15 15:52:15 +03:00
parent 745078f403
commit 768b838015
2 changed files with 14 additions and 8 deletions

View File

@ -40,10 +40,21 @@ class FinishUpdate extends Command
$this->info('Finishing update...');
session(['company_id' => $this->argument('company_id')]);
$this->call('cache:clear');
event(new UpdateFinished($this->argument('alias'), $this->argument('new'), $this->argument('old')));
$alias = $this->argument('alias');
$company_id = $this->argument('company_id');
$new = $this->argument('new');
$old = $this->argument('old');
// Check if file mirror was successful
$version = ($alias == 'core') ? version('short') : module($alias)->get('version');
if ($version != $new) {
throw new \Exception(trans('modules.errors.finish', ['module' => $alias]));
}
session(['company_id' => $company_id]);
event(new UpdateFinished($alias, $new, $old));
}
}

View File

@ -125,11 +125,6 @@ class Updater
public static function finish($alias, $new, $old)
{
// Check if the file mirror was successful
if (($alias == 'core') && (version('short') != $new)) {
throw new \Exception(trans('modules.errors.finish', ['module' => $alias]));
}
$company_id = session('company_id');
$command = "php artisan update:finish {$alias} {$company_id} {$new} {$old}";