Fix: create .env before composer install (artisan needs it for post-scripts)
This commit is contained in:
@@ -23,17 +23,7 @@ mkdir -p storage/logs
|
||||
mkdir -p bootstrap/cache
|
||||
|
||||
# -----------------------------------------------
|
||||
# 1. Composer install
|
||||
# -----------------------------------------------
|
||||
if [ ! -f vendor/autoload.php ]; then
|
||||
echo "[*] Installing Composer dependencies..."
|
||||
composer install --no-interaction --optimize-autoloader
|
||||
else
|
||||
echo "[✓] Composer dependencies already installed."
|
||||
fi
|
||||
|
||||
# -----------------------------------------------
|
||||
# 2. .env file
|
||||
# 1. .env file (must exist before composer/artisan)
|
||||
# -----------------------------------------------
|
||||
if [ ! -f .env ]; then
|
||||
echo "[*] Creating .env from .env.example..."
|
||||
@@ -69,7 +59,7 @@ fi
|
||||
echo "[✓] .env file ready."
|
||||
|
||||
# -----------------------------------------------
|
||||
# 3. Application key
|
||||
# 2. Application key
|
||||
# -----------------------------------------------
|
||||
if grep -q "^APP_KEY=$" .env; then
|
||||
echo "[*] Generating application key..."
|
||||
@@ -86,6 +76,16 @@ else
|
||||
echo "[✓] Application key already set."
|
||||
fi
|
||||
|
||||
# -----------------------------------------------
|
||||
# 3. Composer install
|
||||
# -----------------------------------------------
|
||||
if [ ! -f vendor/autoload.php ]; then
|
||||
echo "[*] Installing Composer dependencies..."
|
||||
composer install --no-interaction --optimize-autoloader
|
||||
else
|
||||
echo "[✓] Composer dependencies already installed."
|
||||
fi
|
||||
|
||||
# -----------------------------------------------
|
||||
# 4. NPM install & build assets
|
||||
# -----------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user