1
0

Improved bundle updating

This commit is contained in:
Richard Dern 2024-05-05 17:31:32 +02:00
parent 4f1d24d22b
commit a0574f4c3d
4 changed files with 32 additions and 9 deletions

View File

@ -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()

View File

@ -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');
}
}
}
}

View File

@ -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;
}
/**

View File

@ -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;
}
/**