Skip to content

Commit f7dfe42

Browse files
committed
Oh the commands
1 parent cc7a823 commit f7dfe42

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

bin/laravel-coderunner

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

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+
411
/*
512
* Install or reset default larvel app
613
*/
714
if (in_array($argv[1] ?? null, ['install-default', 'reset-default'])) {
8-
$command = 'composer run-script install-laravel -d ' . str_replace('/bin', '', __DIR__);
915
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);
1218
die('Done.' . PHP_EOL);
1319
}
1420

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-
2121
/*
2222
* Variable for laravel-coderunner configuration
2323
*/

0 commit comments

Comments
 (0)