Merge pull request #79 from johnpneumann/77_fix_autoload_path

Fix the ternary operator to set the correct autoloadPath
This commit is contained in:
Craig Davis 2018-06-28 07:40:23 -07:00 committed by GitHub
commit 32b76a4a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 6 deletions

View File

@ -7,12 +7,10 @@ $cwd = getcwd();
$templatePath = $baseDir . '/templates';
$consoleTemplatePath = $baseDir . '/src/Resume/Templates';
// When md2resume is installed with composer, it resides in the a
// 'markdown-resume' subdirectory of the 'vendor' directory, so we need to
// walk up a few folders to find 'autoload.php'.
$autoloadPath = basename($baseDir) === 'markdown-resume'
? realpath($baseDir . '/../../autoload.php')
: $baseDir . '/vendor/autoload.php';
// When md2resume is used as a dependency with composer, it resides in the
// 'vendor/markdown-resume' directory. This means that the 'autoload.php' is
// actually much higher in the directory tree than is normally expected.
$autoloadPath = (strpos($baseDir, 'vendor')) ? realpath($baseDir . '/../../autoload.php') : $baseDir . '/vendor/autoload.php';
// If the dependencies aren't installed, we have to bail and offer some help.
if (!file_exists($autoloadPath)) {