Improved bundle updating
This commit is contained in:
parent
4f1d24d22b
commit
a0574f4c3d
|
@ -175,7 +175,7 @@ public function load(): void
|
|||
/**
|
||||
* Store all files of the bundle
|
||||
*/
|
||||
public function save(): void
|
||||
public function save(): bool
|
||||
{
|
||||
$attachmentsSaved = $this->saveAttachments();
|
||||
$metadataSaved = $this->saveMetadata();
|
||||
|
@ -187,19 +187,24 @@ public function save(): void
|
|||
|| $markdownSaved
|
||||
) {
|
||||
$this->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Repair bundle
|
||||
*/
|
||||
public function repair(): void
|
||||
public function repair(): bool
|
||||
{
|
||||
$this->load();
|
||||
$this->repairCover();
|
||||
$this->lintMarkdown();
|
||||
$this->repairAttachments();
|
||||
$this->save();
|
||||
|
||||
return $this->save();
|
||||
}
|
||||
|
||||
public function touch()
|
||||
|
|
|
@ -60,9 +60,13 @@ public function handle()
|
|||
continue;
|
||||
}
|
||||
|
||||
$updater->update();
|
||||
$result = $updater->update();
|
||||
|
||||
$this->info('OK');
|
||||
if ($result) {
|
||||
$this->info('OK');
|
||||
} else {
|
||||
$this->comment('Update not needed');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,8 +88,15 @@ public function update()
|
|||
'wikidata/links',
|
||||
]);
|
||||
|
||||
$this->bundle->save();
|
||||
$this->bundle->repair();
|
||||
$saved = $this->bundle->save();
|
||||
|
||||
if ($saved) {
|
||||
$this->bundle->repair();
|
||||
} else {
|
||||
$saved = $this->bundle->repair();
|
||||
}
|
||||
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -92,8 +92,15 @@ public function update()
|
|||
}
|
||||
}
|
||||
|
||||
$this->bundle->save();
|
||||
$this->bundle->repair();
|
||||
$saved = $this->bundle->save();
|
||||
|
||||
if ($saved) {
|
||||
$this->bundle->repair();
|
||||
} else {
|
||||
$saved = $this->bundle->repair();
|
||||
}
|
||||
|
||||
return $saved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user