4

I'm running a shell script to execute composer install command.

my composer.json file is in /var/www/html

Is there a way I can tell composer not to run under the current directory and to run the composer.json in /var/www/html ?

This is what i've done - but it feels wrong:

cd /var/www/html && composer install
Asaf Nevo
  • 11,338
  • 23
  • 79
  • 154

1 Answers1

6

You can change directory to /var/www/html and then do the composer install like so:

cd /var/www/html && composer install

UPDATE

Actually a better way to do it would be using --working-dir or -d option.

composer install -d=/var/www/html

or

composer install --working-dir=/var/www/html
Sasindu Mendis
  • 346
  • 2
  • 7
  • That is actually what I did, it just looked wrong to me.. felt like composer probably have something generic for that – Asaf Nevo Dec 29 '15 at 15:00