Skip to content

Commit

Permalink
Merge f0d40ec into 8bd5200
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Dec 1, 2021
2 parents 8bd5200 + f0d40ec commit d846051
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ThemeBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static function createFromTheme(Theme $theme): self
// Resolve the directory for the active theme
$root = rtrim(config('Assets')->directory, '/ ') . '/';
$directory = $root . trim($theme->path, '/ ');
$directory = realpath($directory) ?: $directory;

// Locate all CSS and JSS files in the them path
$files = (new FileCollection())
Expand All @@ -41,7 +42,9 @@ public static function createFromTheme(Theme $theme): self

// Create an Asset from each relative path and add it to the Bundle
foreach ($files as $file) {
$file = realpath($file) ?: $file;
$relativePath = str_replace($root, '', $file);

$bundle->add(Asset::createFromPath($relativePath));
}

Expand Down

0 comments on commit d846051

Please sign in to comment.