I'm trying to chain an additional command after an if/else/fi, but I'm getting a syntax error.
Here's what I've got:
mkdir -p storage/app storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache \
&& if [ "$ENV" = "production" ] ; then \
composer install \
; else \
composer install --no-suggest --optimize-autoloader --classmap-authoritative --no-scripts --no-dev --no-cache \
fi ; \
&& chown -R 33:33 . && chmod -R a-sx,ug=rwX,o=rX . && chmod ug+x ./artisan
Error is
/bin/sh: 1: Syntax error: "&&" unexpected
Is there a way I can chain this?
It's going into a Dockerfile so I'm trying to minimize the number of lines.