I just installed fresh copy of stable Symfony 4 as follows:
composer create-project symfony/website-skeleton .
I would like to rename the console script name though from bin/console
to bin/symfony
. How to do that? If I just rename it, after composer install
I get an error:
Script cache:clear returned with error code 1
!! Could not open input file: bin/console
Obviously this comes from the post install script:
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
How to make this work properly? I already checked how to override Symfony's default structure, but found nothing related.
Your error is related to Symfony Flex. If you specify "symfony-cmd" it will look for "bin/console". But it is just a shortcut and you can change it to the following:
"scripts": {
"auto-scripts": {
"bin/symfony cache:clear": "script",
"bin/symfony assets:install --symlink --relative %PUBLIC_DIR%": "script"
}
}