-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
librarian
executable file
·54 lines (43 loc) · 1.43 KB
/
librarian
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env php
<?php
if (php_sapi_name() !== 'cli') {
exit;
}
require __DIR__ . '/vendor/autoload.php';
use App\LiquidTag\Device;
use App\LiquidTag\Embed;
use App\LiquidTag\Guide;
use App\LiquidTag\YouTube;
use Minicli\App;
use Minicli\Exception\CommandNotFoundException;
$app = new App();
$app->setSignature('
_ ____ ____ ____ ____ ____ ____ ____ ____
| | | || \ | \ / || \ | | / || \
| | | | | o )| D )| o || D ) | | | o || _ |
| |___ | | | || / | || / | | | || | |
| | | | | O || \ | _ || \ | | | _ || | |
| | | | | || . \| | || . \ | | | | || | |
|_____||____||_____||__|\_||__|__||__|\_||____||__|__||__|__|
Type "./librarian help" for help with available commands.
');
$app->librarian->boot();
$app->content->registerTagParser('newtube', new YouTube());
$app->content->registerTagParser('device', new Device());
$app->content->registerTagParser('embed', new Embed());
$app->content->registerTagParser('guide', new Guide());
try {
$app->runCommand($argv);
} catch (CommandNotFoundException $notFoundException) {
if ($app->config->debug) {
$app->error("Command Not Found.");
}
return 1;
} catch (Throwable | Exception $exception) {
if ($app->config->debug) {
$app->error("An error occurred:");
$app->error($exception->getMessage());
}
return 1;
}
return 0;