|
1 | 1 | #!/usr/bin/env php
|
2 | 2 | <?php
|
3 | 3 |
|
| 4 | +/* |
| 5 | + * Path to Laravel application (fallback to default laravel app) and default app install |
| 6 | + */ |
| 7 | +define('LARAVEL_CODERUNNER_PROJECT_PATH', $argv[2] ?? __DIR__ . '/../laravel'); |
| 8 | +define('LARAVEL_CODERUNNER_PROJECT_ROOT', LARAVEL_CODERUNNER_PROJECT_PATH . '/public'); |
| 9 | +define('LARAVEL_CODERUNNER_INSTALL_LARAVEL', 'composer run-script install-laravel -d ' . str_replace('/bin', '', __DIR__)); |
| 10 | + |
4 | 11 | /*
|
5 | 12 | * Install or reset default larvel app
|
6 | 13 | */
|
7 | 14 | if (in_array($argv[1] ?? null, ['install-default', 'reset-default'])) {
|
8 | | - $command = 'composer run-script install-laravel -d ' . str_replace('/bin', '', __DIR__); |
9 | 15 | echo 'Installing default laravel app.' . PHP_EOL;
|
10 | | - echo "\e[1m> \e[2;32m" . $command . "\e[0m" . PHP_EOL; |
11 | | - shell_exec($command); |
| 16 | + echo "\e[1m> \e[2;32m" . LARAVEL_CODERUNNER_INSTALL_LARAVEL . "\e[0m" . PHP_EOL; |
| 17 | + shell_exec(LARAVEL_CODERUNNER_INSTALL_LARAVEL); |
12 | 18 | die('Done.' . PHP_EOL);
|
13 | 19 | }
|
14 | 20 |
|
15 | | -/* |
16 | | - * Path to Laravel application (fallback to default laravel app) |
17 | | - */ |
18 | | -define('LARAVEL_CODERUNNER_PROJECT_PATH', $argv[2] ?? __DIR__ . '/../laravel'); |
19 | | -define('LARAVEL_CODERUNNER_PROJECT_ROOT', LARAVEL_CODERUNNER_PROJECT_PATH . '/public'); |
20 | | - |
21 | 21 | /*
|
22 | 22 | * Variable for laravel-coderunner configuration
|
23 | 23 | */
|
|
0 commit comments