diff --git a/bin/ciconia b/bin/ciconia old mode 100644 new mode 100755 index 029bfe3..d14c5e5 --- a/bin/ciconia +++ b/bin/ciconia @@ -7,7 +7,20 @@ if (PHP_SAPI !== 'cli') { echo 'Ciconia command should be run on the CLI environment.' . PHP_EOL; } -require __DIR__ . '/../vendor/autoload.php'; +$paths = [ + // Top-level package. + __DIR__ . '/../vendor/autoload.php', + + // Included as a dependency. + __DIR__ . '/../../../autoload.php', +]; + +foreach($paths as $path) { + if (file_exists($path)) { + require $path; + break; + } +} $app = new Application('Ciconia', \Ciconia\Ciconia::VERSION); -$app->run(); \ No newline at end of file +$app->run(); diff --git a/bin/compile b/bin/compile old mode 100644 new mode 100755 index ec1a432..bce4b53 --- a/bin/compile +++ b/bin/compile @@ -8,8 +8,21 @@ if (PHP_SAPI !== 'cli') { die('Compile command must be run on the CLI environment.'); } -require __DIR__ . '/../vendor/autoload.php'; +$paths = [ + // Top-level package. + __DIR__ . '/../vendor/autoload.php', + + // Included as a dependency. + __DIR__ . '/../../../autoload.php', +]; + +foreach($paths as $path) { + if (file_exists($path)) { + require $path; + break; + } +} $app = new Application('Ciconia Compiler', \Ciconia\Ciconia::VERSION); $app->add(new CompileCommand()); -$app->run(); \ No newline at end of file +$app->run();