Install project in same folder

1,675 views
Skip to first unread message

Oleg Andryev

unread,
Dec 4, 2012, 2:44:00 PM12/4/12
to compose...@googlegroups.com
Hey!

I'm having question about \Composer\Installer\ProjectInstaller::install() method. What if I wanna install project in same folder where my composer.phar lives?
I'm running this: 
$ php composer.phar create-project -s dev symfony-cmf/standard-edition .
Output:
Installing symfony-cmf/standard-edition (dev-master bf591bfcb19be7eac4265fe6138548fb680d8f60)


  [InvalidArgumentException]
  Project directory . already exists.

Why it's done like so?

Jordi Boggiano

unread,
Dec 4, 2012, 2:48:31 PM12/4/12
to compose...@googlegroups.com
Heya,

> Why it's done like so?

Git won't let you clone into an existing dir either. I think this is a
good precaution to avoid messing up any existing data.

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

Oleg Andreyev

unread,
Dec 4, 2012, 3:58:36 PM12/4/12
to compose...@googlegroups.com
> Git won't let you clone into an existing dir either
Weird... I have just done git clone in newly created dir.
admin@admin-pc /cygdrive/d/checkout/openserver/domains
$ mkdir symfony-docs
$ cd symfony-docs/
$ git clone g..@github.com:oleg-andreyev/symfony-docs.git .
Cloning into '.'...
Enter passphrase for key '/home/admin/.ssh/id_rsa':
remote: Counting objects: 23745, done.
remote: Compressing objects: 100% (6625/6625), done.
remote: Total 23745 (delta 17365), reused 23137 (delta 16896)
Receiving objects: 100% (23745/23745), 5.43 MiB | 499 KiB/s, done.
Resolving deltas: 100% (17365/17365), done.
but second point about messing up existing data, is a good point :)


вторник, 4 декабря 2012 г., 21:48:31 UTC+2 пользователь Jordi Boggiano написал:

Sebastian Krebs

unread,
Dec 4, 2012, 4:25:46 PM12/4/12
to compose...@googlegroups.com



2012/12/4 Oleg Andreyev <mrd...@gmail.com>

> Git won't let you clone into an existing dir either
Weird... I have just done git clone in newly created dir.
admin@admin-pc /cygdrive/d/checkout/openserver/domains
$ mkdir symfony-docs
$ cd symfony-docs/
$ git clone g..@github.com:oleg-andreyev/symfony-docs.git .
Cloning into '.'...
Enter passphrase for key '/home/admin/.ssh/id_rsa':
remote: Counting objects: 23745, done.
remote: Compressing objects: 100% (6625/6625), done.
remote: Total 23745 (delta 17365), reused 23137 (delta 16896)
Receiving objects: 100% (23745/23745), 5.43 MiB | 499 KiB/s, done.
Resolving deltas: 100% (17365/17365), done.
but second point about messing up existing data, is a good point :)

Hi,

git tests, wether the directory is empty, or not. Composer could probably do something similar, but on the one hand why creating the directory in the first place, when composer can do it for you? ;) And on the other hand it wouldn't be empty anyway, if the composer.phar is there itself. I think it would be the same effort, if you create the project somewhere else and then copy composer.phar there, even if I don't know why :3

Regards,
Sebastian
 


вторник, 4 декабря 2012 г., 21:48:31 UTC+2 пользователь Jordi Boggiano написал:
Heya,

> Why it's done like so?

Git won't let you clone into an existing dir either. I think this is a
good precaution to avoid messing up any existing data.

Cheers

--
Jordi Boggiano
@seldaek - http://nelm.io/jordi

Reply all
Reply to author
Forward
0 new messages