Skip to content

Commit

Permalink
Merge pull request #140 from sumocoders/fix-asset-mapper
Browse files Browse the repository at this point in the history
Fix asset mapper
  • Loading branch information
tijsverkoyen authored Nov 21, 2024
2 parents 2d61bab + fd02889 commit d765514
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Open `deploy.php` and check the configuration, replace the example values

Try to deploy to staging by running:

symfony php vendor/bin/deployer.phar deploy staging
symfony php vendor/bin/dep deploy stage=staging

Log in through `ssh` on the dev-server and alter the `.env.local`-file to use the
correct credentials.
Expand Down
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 d765514

Please sign in to comment.