Skip to content

Commit

Permalink
Repack - Add local box.json support
Browse files Browse the repository at this point in the history
  • Loading branch information
SebLours committed Mar 9, 2024
1 parent c40d4f8 commit b1e1ab6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
/.castor.stub.php
/.php-cs-fixer.cache
/.phpunit.cache
/box.json
/castor.*
/my-app.*
/var/
Expand Down
8 changes: 8 additions & 0 deletions src/Console/Command/RepackCommand.php
Expand Up @@ -74,6 +74,14 @@ class RepackedApplication extends Application
PHP;

$boxConfig = json_decode((string) file_get_contents($boxConfigFile), true, 512, \JSON_THROW_ON_ERROR);

if (file_exists($localBoxConfigFile = $castorSourceDir . '/box.json')) {
$boxConfig = array_merge_recursive(
json_decode((string) file_get_contents($localBoxConfigFile), true, 512, \JSON_THROW_ON_ERROR),
$boxConfig,
);
}

$boxConfig['base-path'] = '.';
$boxConfig['main'] = '.main.php';
$boxConfig['alias'] = $alias;
Expand Down

0 comments on commit b1e1ab6

Please sign in to comment.