Skip to content

Commit

Permalink
fix: basedir resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
joostfaassen committed Aug 22, 2020
1 parent 9db5779 commit 019267c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/doc/html
Expand Up @@ -5,8 +5,11 @@ use Infra\Sdk\Utils;
use Infra\Service\HtmlGeneratorService;

$baseDir = __DIR__ . '/../../';
if (!file_exists($baseDir . 'composer.json')) {
$baseDir = __DIR__ . '/../../../../../'; // run as a composer dependency
if (!file_exists($baseDir . 'vendor/autoload.php')) {
$baseDir = __DIR__ . '/../../../../../'; // run as a composer dependency
}
if (!file_exists($baseDir . 'vendor/autoload.php')) {
throw new RuntimeException("Error resolving base directory");
}
require_once $baseDir . 'vendor/autoload.php';

Expand Down

0 comments on commit 019267c

Please sign in to comment.