Skip to content

Commit

Permalink
few more tweaks to get it juuuuust right
Browse files Browse the repository at this point in the history
  • Loading branch information
n0nag0n committed May 4, 2024
1 parent 04d9875 commit 1fe2708
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
19 changes: 12 additions & 7 deletions runway
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,29 @@ if(file_exists($cwd.'/.runway-config.json') === false) {
return require __DIR__.'/scripts/setup.php';
}

// Flight::map('start', function() {
// return;
// });

$config = json_decode(file_get_contents($cwd.'/.runway-config.json'), true);

$consoleApp = new Ahc\Cli\Application('runway', '0.2.0');
$consoleApp = new Ahc\Cli\Application('runway', '0.2.1');

$cwd = getcwd();
$paths = [
// Pull all commands from other flightphp repos
__DIR__.'/../flightphp/**/src/commands/*.php',
__DIR__.'/../flightphp/**/flight/commands/*.php',
$cwd.'/vendor/flightphp/**/src/commands/*.php',
$cwd.'/vendor/flightphp/**/flight/commands/*.php',
__DIR__.'/../../**/src/commands/*.php',
__DIR__.'/../../**/flight/commands/*.php',
$cwd.'/src/commands/*.php',
$cwd.'/flight/commands/*.php',

// Pull all commands from other flightphp repos with hyphens
__DIR__.'/../flightphp-**/**/src/commands/*.php',
$cwd.'/vendor/flightphp-**/**/src/commands/*.php',

// Pull all commands from other flightphp repos locally
__DIR__.'/../flightphp-**/src/commands/*.php',
__DIR__.'/../flightphp-**/flight/commands/*.php',
$cwd.'/vendor/flightphp-**/src/commands/*.php',
$cwd.'/vendor/flightphp-**/flight/commands/*.php',

// Pull commands from this repo
__DIR__.'/src/commands/*.php'
Expand Down
21 changes: 19 additions & 2 deletions scripts/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

$interactor->boldBlue('Welcome to the Runway setup wizard!', true);
$interactor->blue('This wizard will help you get your settings correct for your Flight project.', true);

// Main index.php file
$possible_file_locations = [
'1' => 'public/index.php',
'2' => 'index.php',
Expand All @@ -20,9 +22,24 @@
$index_location = $possible_file_locations[$choice];
}

// Core app directory
$possible_app_locations = [
'1' => 'app/',
'2' => 'lib/',
'3' => './',
'4' => 'other'
];
$choice = $interactor->choice('Where is your root app directory where you store all your controllers, views, utility classes, etc?', $possible_app_locations, '1');
if ($choice === '4') {
$app_location = $interactor->prompt('Please enter the path to your root app directory: ');
} else {
$app_location = $possible_app_locations[$choice];
}

$json = json_encode([
'index_root' => $index_location
], JSON_PRETTY_PRINT);
'index_root' => $index_location,
'app_root' => $app_location
], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);

$interactor->boldGreen('Your settings have been saved!', true);
file_put_contents(getcwd() . '/.runway-config.json', $json);

0 comments on commit 1fe2708

Please sign in to comment.