Skip to content

Commit df81966

Browse files
committed
Convert paths to relative within the glob helper
1 parent 6747c14 commit df81966

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/framework/src/Framework/Features/Publications/PublicationService.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Hyde\Pages\PublicationPage;
1212
use Illuminate\Support\Str;
1313
use Rgasch\Collection\Collection;
14+
use function collect;
1415
use function dirname;
1516
use function glob;
1617
use function Safe\file_get_contents;
@@ -31,7 +32,7 @@ class PublicationService
3132
public static function getPublicationTypes(): Collection
3233
{
3334
return Collection::create(self::getSchemaFiles())->mapWithKeys(function (string $schemaFile): array {
34-
$publicationType = PublicationType::fromFile(Hyde::pathToRelative($schemaFile));
35+
$publicationType = PublicationType::fromFile($schemaFile);
3536

3637
return [$publicationType->getDirectory() => $publicationType];
3738
});
@@ -114,6 +115,8 @@ protected static function getPublicationFileData(string $filepath): string
114115

115116
protected static function getSchemaFiles(): array
116117
{
117-
return glob(Hyde::path(Hyde::getSourceRoot()).'/*/schema.json');
118+
return collect(glob(Hyde::path(Hyde::getSourceRoot()).'/*/schema.json'))->each(function (string $path): string {
119+
return Hyde::pathToRelative($path);
120+
})->toArray();
118121
}
119122
}

0 commit comments

Comments
 (0)