Skip to content

Commit

Permalink
Fix setting up asset mapper config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas De Keukelaere committed Nov 21, 2024
1 parent 2d61bab commit aa7b128
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Skeleton/PostCreateProject.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ private static function reconfigureApplication(Event $event): void
file_put_contents($projectDir . '/config/packages/symfonycasts_sass.yaml', $content);

$io->notice('→ Set up asset mapper with framework-core-bundle');
file_put_contents(
$projectDir . '/config/packages/asset_mapper.yaml',
' - vendor/sumocoders/framework-core-bundle/assets-public/',
FILE_APPEND
$content = file_get_contents($projectDir . '/config/packages/asset_mapper.yaml');
$content = preg_replace(
'/(paths:(\r\n|\r|\n) +- assets\/(\r\n|\r|\n))/',
'$1 - vendor/sumocoders/framework-core-bundle/assets-public/' . PHP_EOL,
$content
);
file_put_contents($projectDir . '/config/packages/asset_mapper.yaml', $content);

$io->notice('→ Reconfigure Twig');
$content = file_get_contents($projectDir . '/config/packages/twig.yaml');
Expand Down

0 comments on commit aa7b128

Please sign in to comment.