-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from hydephp/build-manifest
Generate a build manifest after the build hydephp/develop@e9ecc57
- Loading branch information
github-actions
committed
Sep 6, 2022
1 parent
22e2612
commit 7eb407d
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Hyde\Framework\Actions\PostBuildTasks; | ||
|
||
use Hyde\Framework\Contracts\AbstractBuildTask; | ||
use Hyde\Framework\Hyde; | ||
use Illuminate\Console\OutputStyle; | ||
use Illuminate\Support\Collection; | ||
|
||
class GenerateBuildManifest extends AbstractBuildTask | ||
{ | ||
public function __construct(?OutputStyle $output = null) | ||
{ | ||
parent::__construct($output); | ||
$this->output = null; | ||
} | ||
|
||
public function run(): void | ||
{ | ||
$manifest = new Collection(); | ||
|
||
/** @var \Hyde\Framework\Contracts\AbstractPage $page */ | ||
foreach (Hyde::pages() as $page) { | ||
$manifest->push([ | ||
'page' => $page->getSourcePath(), | ||
'source_hash' => md5(Hyde::path($page->getSourcePath())), | ||
'output_hash' => md5(Hyde::path($page->getOutputPath())), | ||
]); | ||
} | ||
|
||
file_put_contents(Hyde::path(config('hyde.build_manifest_path', | ||
'storage/framework/cache/build-manifest.json') | ||
), $manifest->toJson()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters