Closed astorm closed 10 years ago
I just added the requested behavior with some additional teaks with the pull request #99
Why shouldn't I expect the users of the installer to not read the README first? Also everything which happened is able to see in the output of the command, or did happen anything else?
En contraire. Now you are prompted for an input, the extra info is written into the composer.json and optionally the root dir can be created if not existent. It's just more comfortable this way. Exceptions on the other hand are not that helpful from the users point if view.
For now I extended the exception with a few more informations:
You need to set an existing path for "magento-root-dir" in your composer.json
For more information please read about the "Usage" in the README of the installer Package
But will wait for a bit more feedback of others
+1 for Daniel. RTFM first
Why not make it more bulletproof by prompting for the required information!?
Saying "RTFM!" feels more like "I don't want to play with others …"
:-1: for Daniel :+1: for bragento
It such a complex topic that you need to RTFM first. How many annoying prompts would you like to add? Should it end as a Windows app? A little more detailed explanation of the error is always good.
We should keep in mind that only those who don't define extra.magento-root-dir and/or those who don't have the root dir set up will be prompted. Actually I doubt if we should expect each and every USER who tries to install a Magento Module via composer to read any manuals. Using the magento composer installer should be as accessible and easy as possible. Imagine the composer itself requiring you to crate the vendor dir manually before allowing you to install anything, you wouldn't want that either. At some point in the near future I would like to run composer init, define my dependencies there and just start the installation without having to prepare anything beforehand and without having to edit the composer.json by hand.
Further there is actually one more prompt I would like to add: magento-force
implemented by merge of another PR
If a user attempt to install the package without first specifying a magento root directory in extra, composer halts installation in an unknown state with the error message
magento root dir "" is not valid
. If possible, the plugin should prompt for this missing value, and make it clear what has and has not been installed.Steps to Reproduce:
composer.json
matching the file belowcomposer install
Expected Behavior: Composer prompts user for Magento folder location and continues as normal
Actual Behavior: Composer halts with a
ErrorException
, leaving user confused as to what state their system is in.