File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 77use craft \cloud \Helper ;
88use craft \cloud \Module ;
99use craft \helpers \FileHelper ;
10+ use craft \helpers \StringHelper ;
11+ use League \Uri \Components \HierarchicalPath ;
1012use League \Uri \Modifier ;
1113
1214class AssetManager extends \craft \web \AssetManager
@@ -41,6 +43,16 @@ protected function preparePaths(): void
4143 protected function hash ($ path ): string
4244 {
4345 $ dir = is_file ($ path ) ? dirname ($ path ) : $ path ;
46+ $ rebrandPath = Craft::$ app ->getPath ()->getRebrandPath ();
47+
48+ // Account for rebrand, as it lives in @storage by default,
49+ // which will be different in Cloud runtime vs. Cloud build.
50+ if (str_starts_with ($ dir , $ rebrandPath )) {
51+ return HierarchicalPath::new (StringHelper::removeLeft ($ dir , $ rebrandPath ))
52+ ->prepend ('rebrand ' )
53+ ->withoutTrailingSlash ()
54+ ->toString ();
55+ }
4456
4557 // @phpstan-ignore-next-line
4658 $ alias = Craft::alias ($ dir );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace craft \cloud \web \assets \rebrand ;
4+
5+ use Craft ;
6+
7+ class RebrandAsset extends \craft \web \AssetBundle
8+ {
9+ public function init ()
10+ {
11+ $ this ->sourcePath = Craft::$ app ->getPath ()->getRebrandPath ();
12+ parent ::init ();
13+ }
14+ }
You can’t perform that action at this time.
0 commit comments