Merge branch 'develop' into 1.0-develop

This commit is contained in:
Matthew Penner 2022-10-31 12:10:04 -06:00
commit f8ec8b4d5a
No known key found for this signature in database
3 changed files with 47 additions and 1 deletions

View file

@ -0,0 +1,15 @@
<?php
namespace Pterodactyl\Exceptions;
use Exception;
use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Contracts\ProvidesSolution;
class ManifestDoesNotExistException extends Exception implements ProvidesSolution
{
public function getSolution(): Solution
{
return new Solutions\ManifestDoesNotExistSolution();
}
}

View file

@ -0,0 +1,25 @@
<?php
namespace Pterodactyl\Exceptions\Solutions;
use Spatie\Ignition\Contracts\Solution;
class ManifestDoesNotExistSolution implements Solution
{
public function getSolutionTitle(): string
{
return "The manifest.json file hasn't been generated yet";
}
public function getSolutionDescription(): string
{
return 'Run yarn run build:production to build the frontend first.';
}
public function getDocumentationLinks(): array
{
return [
'Docs' => 'https://github.com/pterodactyl/panel/blob/develop/package.json',
];
}
}

View file

@ -5,6 +5,7 @@ namespace Pterodactyl\Services\Helpers;
use Illuminate\Support\Arr; use Illuminate\Support\Arr;
use Illuminate\Filesystem\FilesystemManager; use Illuminate\Filesystem\FilesystemManager;
use Illuminate\Contracts\Filesystem\Filesystem; use Illuminate\Contracts\Filesystem\Filesystem;
use Pterodactyl\Exceptions\ManifestDoesNotExistException;
class AssetHashService class AssetHashService
{ {
@ -106,6 +107,11 @@ class AssetHashService
); );
} }
return static::$manifest; $manifest = static::$manifest;
if ($manifest === null) {
throw new ManifestDoesNotExistException();
}
return $manifest;
} }
} }