Kliment
Kliment

Reputation: 2270

Composer install error when run in shell script

I have shell script for that is executed before start of the application. This is the shell script

#!/bin/sh
/usr/local/bin/composer install
/usr/local/bin/php artisan optimize
/usr/local/bin/php artisan key:generate

when i try to execute this script i get this error

Running composer as root/super user is highly discouraged as packages, plugins and scripts cannot always be trusted


[Symfony\Component\Console\Exception\CommandNotFoundException]
 " is not defined.
 Did you mean this?
   install

The composer executable is installed and works when called from the command line

Upvotes: 2

Views: 1820

Answers (1)

Kliment
Kliment

Reputation: 2270

The trick is putting it like this

#!/bin/sh
`/usr/local/bin/composer install`
`/usr/local/bin/php artisan optimize`
`/usr/local/bin/php artisan key:generate`

Upvotes: 1

Related Questions