Skip to content

Commit

Permalink
Look for autoload in other places
Browse files Browse the repository at this point in the history
  • Loading branch information
zsturgess committed Dec 5, 2015
1 parent 9d96e1c commit 6c610ea
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions sweet-qa
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
#!/usr/bin/env php
<?php
chdir(__DIR__);
require_once 'vendor/autoload.php';
if (file_exists('../../autoload.php')) {
// In vendor/twogether/sweet-qa.
require_once '../../autoload.php';
chdir(__DIR__);
} elseif (file_exists('../vendor/autoload.php')) {
// In parent project's bin/.
require_once '../vendor/autoload.php';
chdir('../vendor/twogether/sweet-qa');
} elseif (file_exists('vendor/autoload.php')) {
// In parent project's root/.
require_once 'vendor/autoload.php';
chdir('vendor/twogether/sweet-qa');
} else {
throw new \RuntimeException('Could not find the autoloader.');
}

use Symfony\Component\Console\Application;
use Twogether\SweetQA\Command as Commands;
Expand Down

0 comments on commit 6c610ea

Please sign in to comment.