Merge pull request #79 from johnpneumann/77_fix_autoload_path
Fix the ternary operator to set the correct autoloadPath
This commit is contained in:
commit
32b76a4a4a
|
@ -7,12 +7,10 @@ $cwd = getcwd();
|
||||||
$templatePath = $baseDir . '/templates';
|
$templatePath = $baseDir . '/templates';
|
||||||
$consoleTemplatePath = $baseDir . '/src/Resume/Templates';
|
$consoleTemplatePath = $baseDir . '/src/Resume/Templates';
|
||||||
|
|
||||||
// When md2resume is installed with composer, it resides in the a
|
// When md2resume is used as a dependency with composer, it resides in the
|
||||||
// 'markdown-resume' subdirectory of the 'vendor' directory, so we need to
|
// 'vendor/markdown-resume' directory. This means that the 'autoload.php' is
|
||||||
// walk up a few folders to find 'autoload.php'.
|
// actually much higher in the directory tree than is normally expected.
|
||||||
$autoloadPath = basename($baseDir) === 'markdown-resume'
|
$autoloadPath = (strpos($baseDir, 'vendor')) ? realpath($baseDir . '/../../autoload.php') : $baseDir . '/vendor/autoload.php';
|
||||||
? realpath($baseDir . '/../../autoload.php')
|
|
||||||
: $baseDir . '/vendor/autoload.php';
|
|
||||||
|
|
||||||
// If the dependencies aren't installed, we have to bail and offer some help.
|
// If the dependencies aren't installed, we have to bail and offer some help.
|
||||||
if (!file_exists($autoloadPath)) {
|
if (!file_exists($autoloadPath)) {
|
||||||
|
|
Loading…
Reference in New Issue