# Create storage folders
mkdir storage/framework/cache
mkdir storage/framework/sessions
mkdir storage/framework/views

# Generate App key
php artisan key:generate

# Seed uploads folder
mv uploads_seeder uploads

rm -f bootstrap/cache/config.php
rm -f bootstrap/cache/packages.php
rm -f bootstrap/cache/services.php

composer install

# Site migrations
php artisan migrate --force

echo 'Installing Cron'
sh crons.sh | crontab -

if [ -f shop/deploy.sh ]; then
    sh shop/deploy.sh
fi

if [ -f cms/deploy.sh ]; then
    sh cms/deploy.sh
fi

# Seed database tables
php artisan database:seed

# Encryption is enabled by default
php artisan encryption:run

npm install && npm run dev