Closed KimberlyMunoz closed 9 years ago
:+1: We ran into this just the other day; forgot to make an issue for it. I think it's better to change the default behavior to create a new directory.
When we were building the Evolved generator, we went through a similar plan but abandoned it because existing directories became messy. It's hard to tell user intent so if a directory already exists should it be updated with new changes in the framework or should the process be aborted. If we do decide to create/overwrite, it isn't hard to use glob to add a checker for an existing directory, and if it comes back true to confirm with the user.
Good call about the check.
And so long as the error message when you find an existing directory is useful ("Directory already exists. Please select another project name.") then it should be easy for the end-user to figure out what they want to do.
There should probably be an option to continue with the installation, otherwise you'll never be able to update an existing project to the latest changes in CF.
The more I use this the more I'm not so sure we should be generating a project folder for the user. Most generators don't and it might be confusing if we don't adhere to the expected behavior.
We should definitely update the instructions to tell the user to mkdir
for the project and then cd
to that directory before running the generator.
:+1: to making the documentation a little clearer.
Gonna reopen this until the CF homepage is updated: http://cfpb.github.io/capital-framework/
Right now, the easy two-step installation results in getting a bunch of files installed in your Sites folder.
The typical behavior for cloning/generating a framework to set up a project usually creates a folder for your project, so as CP gets more use, I can see more folks making the mistake of accidentally installing
yo cf
in their root project folder.We ask for project name in the first step, we should have it create a folder with that name.
Alternative suggestion: In our documentation, can we change:
to