Skip to content

Commit 523e733

Browse files
committed
More robust bootstrapping as vendor app
1 parent 2e80d57 commit 523e733

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

bin/dbtk-schema-loader

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
#!/usr/bin/env php
22
<?php
33

4-
require __DIR__ . "/../vendor/autoload.php";
4+
$baseDir = __DIR__ . '/..';
5+
if (!file_exists($baseDir . '/vendor')) {
6+
$baseDir = __DIR__ . '/../../../..';
7+
}
58

9+
if (!file_exists($baseDir . '/vendor/autoload.php')) {
10+
die(
11+
'File not found: ' . $baseDir . '/vendor/autoload.php' . PHP_EOL .
12+
'You must set up the project dependencies, run the following commands:' . PHP_EOL .
13+
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
14+
'php composer.phar install' . PHP_EOL
15+
);
16+
}
17+
$loader = require $baseDir . '/vendor/autoload.php';
618
$cli = new crodas\cli\Cli;
7-
$cli->addDirectory(__DIR__ . "/../src/Command");
19+
$cli->addDirectory($baseDir . "/src/Command");
820
$cli->main();

0 commit comments

Comments
 (0)