Skip to content

Commit

Permalink
Assets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan-Nicklas Adler committed May 23, 2023
1 parent e521bb5 commit dd06fce
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Core/HelperFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,16 @@ public static function functional(?Money $money): ?string
public static function getAssetsDir(): string
{
$root = self::getRoot();
if (file_exists($root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics")) {
return $root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics";
}

if (file_exists($root . "/Assets")) {
return $root . "/Assets";
$paths = [
$root . "/" . AnalyticsConfig::$assets . "/promatur/sc-analytics",
$root . "/public/" . AnalyticsConfig::$assets . "/promatur/sc-analytics",
$root . "/Assets"
];
foreach ($paths as $path) {
if (file_exists($path)) {
return $path;
}
}

throw new RuntimeException("Could not get asset directory");
}

Expand Down

0 comments on commit dd06fce

Please sign in to comment.