-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request : Ability to create project in current (Existing) directory. #1135
Comments
Well, what should it do in such case ? delete the folder first to be able to install the package properly ? Merging existing content with the content of the package is not a safe install. I don't really think the amount of work for this is worth it. Btw, git or svn don't allow you to clone to in an existing folder either (which would make the work even harder for us by having to implement some workaround for the GitDownloader and the ZipDownloader btw) |
Both git and svn allow you to clone into an existing directory, but it must be empty. |
I think this might be handy, if allowed only for empty directories. |
I vote for ability to create a new project in an existing empty directory, the same way as |
I would just add : If the only file in the directory is composer.phar then treat the directory as empty |
@purplefish32 why ? It would make it still have the same issue: git and svn don't allow to clone in a non-empty directory, thus requiring to implement some workaround. |
@stof Just for the sake of simplicity, I am scripting a custom installer for Symfony and a few bundles via ServerTools (https://github.com/JoshuaEstes/ServerTools), seems logic to me to create a new project folder then the script will pull in composer, set up symfony etc... |
@purplefish32 but why would you need to put composer in the folder in which the project will be setup ? Couldn't you put it in the parent folder ? |
@stof I guess I can live with that |
And why can't you have composer in system-wide directory? Like |
@hosiplan Allthough this may at first seem to be the ideal solution (It is the one I use when not trying to script installs), I see a few drawbacks when
I do understand that Capistrano clones the repo before installing composer via curl and that there must be some issues with As I said before if this is really too difficult I will stick with my plan B and install via a temp directory. |
@purplefish32: Imho that's responsibility of system administrator - not programmer. But I agree this would be neat if allowed for emty directories, ignoring |
It sounds to me like it's not worth the trouble (at least the composer.phar thing, because most likely to allow this we need to rm the dir, chdir to the parent and then run the code), but if someone gets it to work without too much insanity I'm not against it. |
… tests, and update to Composer/Downloader/VcsDownloader.
+1 |
1 similar comment
+1 |
thanks guys, eve though authors are not commenting i am positive on this one too, let's work on this on the weekend @bzitzow see you then |
As I said before (not sure if it was in person at SfLive SF or here, but whatever) I will accept this as creating a project in an existing empty directory. If it has content, you can't do anything. That's how git & friends work and I think it makes a lot of sense, rm -rf should be able to reverse whatever you did in an easy way, and if we start mixing stuff with existing files that goes against this. |
@Seldaek I do have a case where it might be very helpfull : I did a composer "project", that will help us to do migration from legacy application. So all old code are moved in a directory call legacy, then we can now call Composer. But for now, I need to create a new project, then copy all files in the old project. |
@ph-il that sounds like a pretty temporary use case for a one-time conversion. Not really something I would consider valid in the bigger picture, and anyway this is just not feasible easily due to git constraints etc, so it's very unlikely it will happen. |
I found this thread when looking for such a feature. My case is that I'm starting a new project and I'm using Vagrant. I need a place to put the vagrant files, which i've put in the project root (typical practice, I believe). But after starting Vagrant, which automatically mounts the project folder, I can't create a Symfony project because the folder is already populated with vagrant files. So I have to install Symfony into it's own folder within the project, which is redundant. It's obviously not the worst thing in the world. It's just extra trouble to achieve the folder structure I had in mind. |
Also i create an emtpy project with PHPStorm. I want to install Symfony2 within PHPStorm terminal but it says directory already exists. So i have to create it into a new folder and copy the content into the root. I would be cool to have a --force command. |
+1 |
2 similar comments
👍 |
+1 |
+1 |
I was searching for this feature as well. Although using git clone to current directory works, it would by nice if composer itself supported it. |
👍 |
I would really like to be able to override the create-project test that disallows installation if the destination directory exits.
What I am trying to achieve :
I am aware that in the documentation it states : "The directory is not allowed to exist, it will be created during installation."
My feature request is to be able to override the test (Something like --force) so that I can install in the current directory where the only other file is composer.phar anyway
The text was updated successfully, but these errors were encountered: