Skip to content

Commit

Permalink
More fixes for #246
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsykun committed Apr 23, 2024
1 parent 8ff90ba commit a3e3341
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Package/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,8 @@ public function __construct(
ErrorHandler::register();
}

public function setSerializerCachePath(string $serializerCachePath): void
public function setSerializerCachePath(?string $serializerCachePath): void
{
if (!mkdir($serializerCachePath, true) && !is_dir($serializerCachePath)) {
throw new \RuntimeException(sprintf('Directory "%s" was not created', $serializerCachePath));
}

$this->serializerCachePath = $serializerCachePath;
}

Expand Down Expand Up @@ -906,6 +902,9 @@ private function prepareReadme(string $readme, ?string $host = null, ?string $ow
$config->set('Attr.EnableID', true);
$config->set('Attr.AllowedFrameTargets', ['_blank']);
if ($this->serializerCachePath !== null) {
if (!is_dir($this->serializerCachePath)) {
@mkdir($this->serializerCachePath, recursive: true);
}
$config->set('Cache.SerializerPath', $this->serializerCachePath);
}

Expand Down

0 comments on commit a3e3341

Please sign in to comment.