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
|
* Store all files of the bundle
|
||||||
*/
|
*/
|
||||||
public function save(): void
|
public function save(): bool
|
||||||
{
|
{
|
||||||
$attachmentsSaved = $this->saveAttachments();
|
$attachmentsSaved = $this->saveAttachments();
|
||||||
$metadataSaved = $this->saveMetadata();
|
$metadataSaved = $this->saveMetadata();
|
||||||
|
@ -187,19 +187,24 @@ public function save(): void
|
||||||
|| $markdownSaved
|
|| $markdownSaved
|
||||||
) {
|
) {
|
||||||
$this->touch();
|
$this->touch();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Repair bundle
|
* Repair bundle
|
||||||
*/
|
*/
|
||||||
public function repair(): void
|
public function repair(): bool
|
||||||
{
|
{
|
||||||
$this->load();
|
$this->load();
|
||||||
$this->repairCover();
|
$this->repairCover();
|
||||||
$this->lintMarkdown();
|
$this->lintMarkdown();
|
||||||
$this->repairAttachments();
|
$this->repairAttachments();
|
||||||
$this->save();
|
|
||||||
|
return $this->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function touch()
|
public function touch()
|
||||||
|
|
|
@ -60,9 +60,13 @@ public function handle()
|
||||||
continue;
|
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',
|
'wikidata/links',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->bundle->save();
|
$saved = $this->bundle->save();
|
||||||
$this->bundle->repair();
|
|
||||||
|
if ($saved) {
|
||||||
|
$this->bundle->repair();
|
||||||
|
} else {
|
||||||
|
$saved = $this->bundle->repair();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $saved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,8 +92,15 @@ public function update()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->bundle->save();
|
$saved = $this->bundle->save();
|
||||||
$this->bundle->repair();
|
|
||||||
|
if ($saved) {
|
||||||
|
$this->bundle->repair();
|
||||||
|
} else {
|
||||||
|
$saved = $this->bundle->repair();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $saved;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user