public function fire()
{
$this->info('Updating manifest');
$manifest = destiny()->manifest();
$this->url = bungie(array_get($manifest, 'mobileWorldContentPaths.en'));
$this->version = array_get($manifest, 'version');
$this->versionFile = base_path('database/manifest/.version');
$this->versionDb = base_path("database/manifest/{$this->version}.sqlite");
if (!is_file($this->versionFile)) {
\File::put($this->versionFile, '');
}
$currentVersion = \File::get($this->versionFile);
$versionChanged = $this->version !== $currentVersion || !is_file($this->versionDb);
if ($this->option('extract') || $this->option('download') || $versionChanged) {
if ($this->option('download') || $versionChanged) {
$this->download();
}
$this->extract();
$this->call('cache:clear');
} else {
$this->comment('No updates available.');
}
$this->line("<info>Current version:</info> <comment>{$this->version}</comment>");
}