Merge pull request #6 from nocoolnametom/nocoolnametom-patch-autoloader
Change autoloader requirement for bin file
This commit is contained in:
commit
5d58b3674d
1 changed files with 22 additions and 1 deletions
|
@ -1,6 +1,27 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?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\Composer;
|
||||||
use Composer2Nix\Generator;
|
use Composer2Nix\Generator;
|
||||||
|
|
Loading…
Reference in a new issue