Merge pull request #6 from nocoolnametom/nocoolnametom-patch-autoloader

Change autoloader requirement for bin file
This commit is contained in:
Sander van der Burg 2020-03-14 23:43:29 +01:00 committed by GitHub
commit 5d58b3674d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,27 @@
#!/usr/bin/env php
<?php
require_once(dirname(__FILE__)."/../vendor/autoload.php");
$autoloadLocations = [
getcwd() . '/vendor/autoload.php',
getcwd() . '/../../autoload.php',
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
];
$loaded = false;
foreach ($autoloadLocations as $autoload) {
if (is_file($autoload)) {
require_once($autoload);
$loaded = true;
}
}
if (!$loaded) {
fwrite(STDERR,
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
'php composer.phar install' . PHP_EOL
);
exit(1);
}
use Composer2Nix\Composer;
use Composer2Nix\Generator;