diff --git a/bin/moko b/bin/moko index f0f600b..3d6701f 100644 --- a/bin/moko +++ b/bin/moko @@ -68,6 +68,11 @@ declare(strict_types=1); $repoRoot = dirname(__DIR__); $autoloader = $repoRoot . '/vendor/autoload.php'; +// Support global Composer installs (e.g. composer global require) +if (isset($GLOBALS['_composer_autoload_path'])) { + $autoloader = $GLOBALS['_composer_autoload_path']; +} + if (!is_file($autoloader)) { fwrite(STDERR, "Error: vendor/autoload.php not found.\nRun: composer install\n"); exit(2);